-
Notifications
You must be signed in to change notification settings - Fork 303
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
No failure when exceeding recovery_attempts
#549
Comments
Feel free to submit a PR. Connections that are out of retry attempts should transition to the closed state, which will automatically lead to any operation on it throw an exception. |
@michaelklishin ok, sounds good. I will work on a PR. |
Note that connection recovery happens in the I/O loop thread. But setting an ivar that would stop recovery attempts from happening should be enough and only the I/O loop thread should mutate it (at least in theory). |
Hi @robinroestenburg! Did you have any luck in a PR for this? If not, I can take a look. Thanks |
@arlandism unfortunately I have not had the time for it yet, using a hack in our code for now (reading |
…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.
Issue #549: Move connection to closed state when recovery attempts fail
Resolved in #556 contributed by @arlandism. |
Thanks @arlandism 👍 |
Reproduction scenario:
automatically_recover: true
recovery_attempts: 5
network_recovery_internal: 5
"Ran out of recovery attempts"
.No exception is raised by Bunny.
No exception is generated by Bunny.
Expectation:
Error/exception is generated when either:
Cause
See the following lines: https://github.com/ruby-amqp/bunny/blob/master/lib/bunny/session.rb#L745-L756
If a network failure happens the exception is caught and the retry mechanism kicks in. When the maximum number of recovery attempts has been reached, the
should_retry_recovery?
method will returnfalse
and Bunny will swallow the exception.This is a problem, because:
The original commit message for the
recovery_attempts
feature can be found here: fff7f44It states:
It is not re-raising the original exception right now. I tried to add it locally, but that didn't seem to work. Maybe you have some ideas?
If you need any more information please let me know.
The text was updated successfully, but these errors were encountered: