Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making POST on 'refresh' permamently deregisters the service from Eureka #1857

Closed
AmberHuang05 opened this issue Apr 13, 2017 · 21 comments
Closed
Assignees
Labels
Milestone

Comments

@AmberHuang05
Copy link

AmberHuang05 commented Apr 13, 2017

I have config-server registered as a eureka-server client, another config-client also registered as a eureka-server client, config-server using native call to load the local file config properties. Each time, when I POST a /bus/refresh call to config-server, the config-client get the updated properties but immediately they both get permanently unregistered with Eureka-server unless we restarted them. by the way, the config-server and config-client both listened a local rabbitmq server.

I see this issue in almost the latest version which have the dependency management like below

<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-dependencies</artifactId>
				<version>Dalston.RELEASE</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>
	</dependencies>
</dependencyManagement>

Also tried the version Dalston.RC1, no luck
I also see a lot of people talked about this issue before, like
#1652
or #421
They all marked as fixed. Which version has the fix in it?

@spencergibb
Copy link
Member

@AmberHuang05 if you'd like us to look further, please provide a project on github or zipped up, not a partial project in badly formatted comments.

@AmberHuang05
Copy link
Author

AmberHuang05 commented Apr 13, 2017

https://github.com/AmberHuang05/config-setting
have 3 zip files. Are they enough? Also I set up a local rabbitmq server, all default installation and setting
step1: start the rabbitmq server
step2: start the discovery-server
step3: start the config-server
step4: start the config-client
step5: check the http://localhost:1111, eureka monitor page, we can see both config-server and config-client instances were registered.
step6: send a POST request to config-server instance, like curl -X POST http://localhost:7001/bus/refresh
step7: go back to http://localhost:1111 page, see both config-server and config client instances were deregistered permanently from eureka server.

@ryanjbaxter
Copy link
Contributor

My guess is this is some kind of weird timing issue. If I start setting breakpoints and debugging through the code, I will notice the server will successfully reregister with the server. However without the breakpoint the reregistration does not happen correctly.

@ryanjbaxter
Copy link
Contributor

The problem appears to be that during the refresh event the CloudDiscoveryClient is destroyed and the shutdown method in Eureka client is called. This unregisters the client from Eureka but since the EurekaClient bean is used anywhere after the refresh event the EurekaClient bean is not recreated so we do not reregister the client. We need to force the EurekaClient to be recreated in order to make sure the client is reregistered.

@AmberHuang05
Copy link
Author

AmberHuang05 commented Apr 18, 2017

I just uploaded a new zip file cloud-discovery-config.zip in https://github.com/AmberHuang05/config-setting
This sample did not use rabbitmq or message bus. It only contains Eureka server, config server and config client. Both config-server and config-client registered to Eureka server. After we send out a refresh post message to config client instance, the config-client instance was deregistered to Eureka server permanently.
But in this case, config server still registered with Eureka( it is one eureka client though ;-))

@taoyingqi
Copy link

Waiting for fix

@spencergibb
Copy link
Member

There's currently no timeline for Dalston.SR1

@KarlManong
Copy link

got the same issue, waiting for the fix

@yangy608
Copy link

yangy608 commented May 9, 2017

Waiting for fix

@spencergibb
Copy link
Member

Should be this week (if not, next).

@brahim-ghazi
Copy link

Waiting for fix

@GerardMasip
Copy link

Waiting for fix too. Any update or release date?

@ryanjbaxter
Copy link
Contributor

Netflix 1.3.1 was released yesterday. The next Dalston release containing Netflix 1.3.1 will be released shortly.

@GerardMasip
Copy link

@ryanjbaxter Thanks for the info

@z07cj013
Copy link

@ryanjbaxter Thanks, it's fixed.

@ityouknow
Copy link

ityouknow commented May 27, 2017

yes! Thanks all, it's fixed, i used recent pom.

         <dependency>  
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>Dalston.SR1</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>

@sunnykaka
Copy link

sunnykaka commented Dec 19, 2017

I'm still use Dalston.Release version. How to fix it in my project?

@spencergibb
Copy link
Member

Then you won't get the fix

@sunnykaka
Copy link

@spencergibb
You are right, I'll try to upgrade version to SR4.

@wolf8334
Copy link

Hi.I am using the version Edgware.RELEASE.When I call the endpoint bus/refresh,the issue happened.Could someone plz tell me how to walk around this?

@ryanjbaxter
Copy link
Contributor

If you think there is a bug, please open another issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests