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
Retry on NoRouteToHostException #26
Comments
That's a new one for me. Do you happen to have a stacktrace? I'm curious where it gets thrown. |
Sorry, should have included that to begin with: java.net.NoRouteToHostException: No route to host Right after that is my code calling Connections.create(options, retryConfig);, then the threads and web framework I'm using. |
If the connection is done by hostname, and the host name resolves in DNS, that is thrown (assuming the host isn't up). If an IP is specified, and that host isn't available, the same stack trace happens with that. If a hostname is provided that doesn't resolve in DNS, a DNS related exception is thrown, and that isn't retryable, which makes sense to me. |
I tried reproducing this on my machine (running OSX) and the only way I could get a NoRouteToHostException was by adding a route ( |
Turns out it appears to be OS specific. I tried replicating on Windows and was not able to. I haven't had a chance to try on RedHat, but I'm getting the error on Ubuntu 13.10. So it appears that this is a Linux problem. |
If it's just an Ubuntu thing (perhaps it's a specific JRE version?) I'd lean towards not making this exception retryable. For any failure that isn't likely to be resolved while retrying, we should just throw right away. Another option I've though of is to make the set of failures that are retryable a configurable thing. Still, having that be OS specific is not ideal. |
Closing for now unless this exception proves to be something broader or something that should be recoverable. |
Vary sad, because it is often reproducible when servers with rabbit just restarted on amazon ec2. |
@jhalterman while @sergeyleyko what do you use for the hostname parameter, private IPs or private DNS? Public DNS? |
@michaelklishin we use just custom DNS name assigned to EC2 instance. (not Public DNS generated by AWS). |
@sergeyleyko so your DNS is not managed by AWS in any way? |
@michaelklishin Yes, it is managed by 3rd party service. Just pointed to ec2 instance |
@sergeyleyko then this is not AWS-specific. Still, I think it's reasonable to expect |
@michaelklishin you are right. by the way, to add exception just use config.getRecoverableExceptions().add(newExceptionToRecover) |
@sergeyleyko If NoRouteToHost actually is recoverable, I'm fine with adding it to the default list. Curious: how long does it usually take to recover after a restart and a NoReouteToHostException? How long before the DNS issues are resolved? |
@jhalterman I was wondering if adding NoRouteToHostException is going to be added to the default list (or is this something that we can edit?). We're getting this issue on a deployment where the RabbitMQ instance goes down briefly each night and right now we have to do a corresponding restart of our services using Lyra on ubuntu instances. |
@numbat I'm super tied up on other projects at the moment, but two options:
|
Cheers will do, thanks! |
Adding NoRouteToHost to permanent list of recurring exceptions #26
Was addressed in 99ca312. |
In our environment, it is entirely possible for systems to be trying to connect to our RabbitMQ server, while the server itself is down. Trying a new connection to a system that is powered off results in a NoRouteToHostException. In our case it would certainly make sense for that to be a retryable error.
The text was updated successfully, but these errors were encountered: