-
Notifications
You must be signed in to change notification settings - Fork 353
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
rsocket-load-balancer first request always ends up with error #713
Comments
I have a similar problem with you. When the client side starts up, it finds that LoadBalancedRSocketMono#activeSockets is sometimes unavailable, so I want to get availability through LoadBalancedRSocketMono#availability() and wait for WeightedSocket to be generated asynchronously, but sometimes, availability() finds null elements in activeSockets and throws java.lang.NullPointerException |
I changed the code and successfully tested the new behavior using https://github.com/juri8/rsocket-java/tree/bugfix/load-balanced-rsocket-mono-error-handling |
Hey @mmaszkie @nicpuze @juri8! The reason for the issue was the default fail-fast strategy, which had a place only when there are no active sockets in the pool. In this particular case, such may happen when the new instances have not been yet resolved, but there was a subscription on the LoadbalancedRSocketMono to get a one. In that case, the FailinRSocket instance was returned, which led to the We have fixed that with the 1.1.0-M1 release and introduced the new Loadbalance API. You may give it a try by following this example |
Hi,
I have a problem with rsocket-load-balancer. I have one instance of client application and 2 instances of server application. They are communicating via RSocket (request/response interaction model) using rsocket-load-balancer on the client side. Unfortunately first request always ends up with an error on the client side.
Scenario:
Described behaviour is not random, but repeatable. I noticed that during LoadBalancedRSocketMono initialization, constructor of WeightedSocket class calls subscribe() method on Mono<RSocket> object. I think this situation can lead to inconsistency between RSocket state from application perspective and their general availability beacause of subscribe() method asynchronism. Is this intuition correct? Or maybe I did something wrong? In that case how can I solve this problem?
The text was updated successfully, but these errors were encountered: