Skip to content
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

Issue #549: Move connection to closed state when recovery attempts fail #556

Merged
merged 1 commit into from
Jul 28, 2018

Conversation

arlandism
Copy link
Contributor

@arlandism arlandism commented Jul 27, 2018

See #549 for a more thorough description of the problem.

A gist:

When the RabbitMQ server goes down, the session attempts to continually
reconnect, only stopping once the recovery_attempts threshold is met (or
forever is this parameter is not provided). In the former case, there
are no exceptions raised to indicate to clients that new messages are
not being processed. This patch provides that by initiating close
from the session, which will close related channels and the reader
loop. Then, an exception will be thrown when subsequent operations are
performed.

Client code will now be able to rescue Bunny::ConnectionClosedError to gracefully degrade.

…ery attempts

are exhausted

When the RabbitMQ server goes down, the session attempts to continually
reconnect, only stopping once the recovery_attempts threshold is met (or
forever is this parameter is not provided). In the former case, there
are no exceptions raised to indicate to clients that new messages are
not being processed. This patch provides that by initiating close
from the session, which will close related channels and the reader
loop. Then, an exception will be thrown when subsequent operations are
performed.
@michaelklishin michaelklishin merged commit 5eb1356 into ruby-amqp:master Jul 28, 2018
@michaelklishin
Copy link
Member

This solution makes a lot of sense. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants