-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Eureka Server and Client incompatible between Angel (1.0.x) and Brixton (1.1.x) #978
Comments
So did some more poking around after the release of Brixton and I've discovered a couple more things. Also now providing the configuration that I'm using for testing this error. https://github.com/shanman190/eureka-error There are two branches in the above project that demonstrate the middle two issues. So the first new thing that I've found is that at least in my setup I have the following facts: Ubuntu 16.04 LTS When running in configuration 2 (server Brixton, client Angel), the instanceId is in the same configuration as what Spencer recommends in pr-608 from the customers service example. The thing that I notice here is that when the client calls over to the server it's trying to query for When running in configuration 3 (server Angel, client Brixton), Initially, on startup, we register with an In summary,
Config 3:
|
+1 for this, suffering from incompatibility between 1.0.3 server and 1.1.0 client. |
afe8f4d introduces a fix for 3) by setting the following:
Angel Server expects the value of |
@spencergibb That part definitely looks good to fix the instanceId problem. Is there a way that you know of to easily disable the 404 json with the Angel eureka server? That would fix the second part of 3 preventing the instance from re-registering. |
@shanman190 I'm not seeing a 404 for 3 with my fix. |
@spencergibb The 404 will come from the eureka server after performing a restart of the server application and the client sending it's next heartbeat. In my example, I'm running a single node, so there isn't replication. The problem originates from a change to the Eureka DiscoveryClient.HeartbeatThread (1.1.147) and AbstractJerseyEurekaHttpClient (1.4.6) (this is where the heartbeat moved to) where it was looking for a status code of 404 coming back from Eureka Server and now it's looking for the response body having content. DiscoveryCleint.HeartbeatThread: AbstractJerseyEurekaHttpClient: |
So I realize that my previous comment isn't very clear, so I'm going to add some more information in the hope that my previous comment becomes a little bit more clear. Steps:
If there was a way to disable the json response body then the exception caused by the incorrect deserialization would be skipped and the Eureka response would return back to the renew method of the DiscoveryClient and it then checks for the 404 response code and re-registers the client with the server. |
Thanks for all the analysis. Here's my summary:
|
Update: #1033 is only a problem with the Angel server, so it's not a high priority. As far as I can tell we have it all covered in the issue. There might still be some issues with the client thrashing its registration (see comments with log snippets in #1013), so I'm going to leave this open for a bit in case we can work out what that means. |
The Angel client has an idiosyncratic way of calculating an instance id, and the Brixton client aligned with that already, but the Brixton server did not. This change should make Brixton Eureka Servers work with Angel clients. See gh-978
It's on master (now). |
I've tested the issue as well using the latest Brixton snapshot and can confirm that upgrading the eureka server to the Brixton snapshot allows both eureka clients running Angel and Brixton to properly register and re-register after the server has been restarted. This most definitely fixes scenario 2 and gives users an upgrade path from Angel to Brixton when utilizing Eureka service discovery. @dsyer You're welcome. Glad to help and thank you and @spencergibb for all the work that went into correcting this issue! |
Does this fix will be part of release 1.1.1 ? |
@ouaibsky yes, @dsyer's fix for item 3 a0c1b4c would be part of 1.1.1 (Brixton.SR1). My fix for item 2 (#978 (comment)) would be part of 1.0.x and Angel.SR7. |
Thx a lot |
Is there any thought on when the Brixton.SR1 release is going to be? |
Probably next week (still waiting for a couple of bug fixes). |
What is the process to push releases on maven central ? but nothing in central: http://search.maven.org/#search|gav|1|g%3A%22org.springframework.cloud%22%20AND%20a%3A%22spring-cloud-netflix-eureka-server%22 Christophe |
The process isn't finished yet. |
Brixton SR1 fixed the problem for me. Good job, thanks. |
In my opinion this works only when in the Angel client has no custom 'eureka.instance.metadataMap.instanceId' set. In my case the Angel client has:
In this case the client tries to register itself all 30 sec:
Brixton.SR1 Eureka Server logs:
|
Thanks for the logs. Can you please open a new issue specifically about this scenario? |
After doing a fair bit of investigation with this I have found that the Eureka server and client components have some odd functionality between the two versions. This issue is mostly just for others running into this same problem during the upgrade path. If a solution can be found then that would be great, but there seems to be some documentation that is missing if this is what is going to happen going forward.
So there are 4 scenarios in total: (Angel.SR6 and Brixton.RC2 are the versions being used below)
Numbers 1 and 4 work as expected. However, numbers 2 and 3 have some differing results.
With 2, the client registers, but continues to register time after time. I found that this is because the instanceId doesn't match what is stored in eureka server. With this setup, I don't have access to the hostname via the configuration properties, so I can't get the instanceId populated with the same value that eureka server contains without doing some code magic.
With 3, the client is able to register on the first lookup, but if the instance can't be found in eureka server then it never is able to re-register and get back to the up state. One thing to note on this flavor as well is that I had to make the
eureka.instance.metadata.instanceId
property look exactly like the second half of the instanceId created dynamically by theorg.springframework.cloud.commons.util.IdUtils
class. So the resulting value ended up being:${spring.application.name}:${server.port}
in my test case and the instanceId field was${spring.cloud.client.hostname}:${spring.application.name}:${server.port}
. Upon digging further into this version of the issues I found that in thecom.netflix.discovery.shared.transport.jersey.AbstractJerseyEurekaHttpClient#sendHeartBeat
method that it was updated to see if the response had a body or not, since the response is a 404 the body doesn't match what it's expecting to get back and then throws a mapping exception. This path is what ends up causing the failure to re-register.The text was updated successfully, but these errors were encountered: