Reputation: 4826
Consider this set-up:
enableSelfPreservation: false
And one of the instances (say srv#1inst#1, an instance of service#1) sent a heartbeat, but it did not reach the Eureka server.
AFAIK, following actions take place in sequence on Server side:
Now on instance (srv#1inst#1) side:
AFAIK, the eviction and registration do not happen immediately. Eureka server runs separate scheduler for both tasks periodically.
I have some questions related to this process:
Upvotes: 4
Views: 607
Reputation: 4826
This question was answered by qiangdavidliu in one of the issues of eureka's GitHub repository.
I'm adding his explanations here for sake of completeness.
Before I answer the questions specifically, here's some high level information regarding heartbeats and evictions (based on default configs):
Timeout
or RejectedExecution
), but this should be very rare.Let me try to answer your questions:
Are the sequences correct? If not, what did I miss?
A: The sequences are correct, with the above clarifications.
Is the assumption about eviction and registration scheduler correct?
A: The eviction is handled by an internal scheduler. The registration is processed by the handler thread for the registration request.
An instance of service#2 requests fresh registry copy from server right after ServerStep2.
- Will srv#1inst#1 be in the fresh registry copy, because it has not been evicted yet?
- If yes, will srv#1inst#1 be marked UP or DOWN?
A: There are a few things here:
The retry request from InstanceStep2 of srv#1inst#1 reaches server right after ServerStep2.
- Will there be an immediate change in registry?
- How that will affect the response to instance of service#2's request for fresh registry? How will it affect the eviction scheduler?
A: again a few things:
Upvotes: 1