synchronized private void beginAutomaticRecovery() throws InterruptedException { Thread.sleep(this.params.getNetworkRecoveryInterval());
this.notifyRecoveryListenersStarted();
while (!connected) {
... attempt reconnection and sleep after a failure
}
}--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--MKStaff Software Engineer, Pivotal/RabbitMQ
This should read: "we do not do retrying in a tight loop".
On Wed, Sep 27, 2017 at 7:48 AM, Michael Klishin <mkli...@pivotal.io> wrote:
Because even though whatever could have interrupted the connection is almost certainly transient, it israre to see such issues go away in milliseconds. For the same reason we do not do retrying in a right loop.You can greatly reduce the interval from the default one of 5s and if it works for you, by all means stick with it.
On Wed, Sep 27, 2017 at 5:13 AM, vikinghawk <michae...@gmail.com> wrote:
While investigating some issues with client recovery taking longer than expected (due to heavy load on server), I noticed the java client sleeps for networkRecoveryInteveral millis right away. It then attempts to connect and if it fails sleeps for networkRecoveryInteveral millis again. My question is why the initial sleep?synchronized private void beginAutomaticRecovery() throws InterruptedException {Thread.sleep(this.params.getNetworkRecoveryInterval());this.notifyRecoveryListenersStarted();
while (!connected) {
... attempt reconnection and sleep after a failure
}
}In the case where a node in the cluster is brought down (rather than network loss), it would be better to remove the 5 second (default) wait and attempt reconnect immediately. This would allow clients to failover to other nodes with less downtime.I can submit a PR for the change, but wanted to check in here first to make sure this idea was sound and the sleep wasn't there for a specific reason.
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--MKStaff Software Engineer, Pivotal/RabbitMQ
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.