-
Notifications
You must be signed in to change notification settings - Fork 13
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
resilient is trying to resolve servers during resolving servers in prev request #143
Comments
Discovery process and requests are indepent workflows across requests. This should not be possible. It's true that discovery request can happen multiple times if the first discovery process was not satisfied. This is something that can be changed using a synchronization mechanism. |
If you provide more details, such as the type of error you're getting, and some code to reproduce it, I might be able to assist you better. |
This is my example
This is my result
And, how can I use a synchronization mechanism? |
You can implement the synchronization inside your Eureka middleware by keeping a global state of the discovery requests. E.g: during the first discovery request call within your middleware logic, you create a promise that would be resolved only when you get the response from Eureka. Subsequent concurrent discovery calls would check if that promise exists and would subscribe to it instead of performing the discovery process again. |
I wanted to use your solution but it makes overhead for requests. And I think that several equal requests is bad approach. I made small fix for my team and I hope it will make the lib better. |
I have a problem:
I send request number 1.
Resilient sends request to discovery service for getting hosts of app.
At that time I send request number 2.
Resilient sends request to discovery service for getting hosts of app again.
Now this is what happens: request 1 falls down because second request kills response 1 from discovery service.
It keeps happening until resilient gets new requests before it gets a reply from a discovery service.
Is there a solution of this problem without fixing it in your code? Or maybe you can tell me how can I hardfix it in my fork?
The text was updated successfully, but these errors were encountered: