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
NPE is thrown when LoadBalancer returns null server #427
Comments
ILoadBalancer.chooseServer() unfortunately doesn't say it can return null,
neither says that returning null is transient.. I think we should get this
clarified with Ribbon in case it is a bug that this api returns null.
Can you try a later version of ribbon, then open a ticket if this still
happens (null instead of an exception)?
|
@adriancole The latest version of ribbon has the code I posted above: Do you mean to find a bug against ribbon? |
yep open a bug in ribbon: ILoadBalancer.chooseServer() needs to document how we should interpret a null result. Otherwise, we could retry forever on a bug that isn't transient. |
Looking over the latest version of Ribbon, while it does not say that From my perspective, I think it is acceptable for us to catch this scenario and throw a |
Closing due to inactivity. |
Cause:
LoadBalancingTarget.java
BaseLoadBalancer
SynchronousMethodHandler.java
If
lb.chooseServer(null);
returns null, then an NPE is thrown and it cannot be caught by the retryer, since it can only catch RetryableException.Stacktrace:
The text was updated successfully, but these errors were encountered: