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

Add topology recovery started method to RecoveryListener #668

Merged
merged 3 commits into from
Feb 15, 2021
Merged

Add topology recovery started method to RecoveryListener #668

merged 3 commits into from
Feb 15, 2021

Conversation

vikinghawk
Copy link
Contributor

Proposed Changes

This adds a default method to the RecoveryListener interface that notifies the listener when connection & channel recovery is complete and that topology recovery is now starting.

Once the connection & channels have been recovered, it is safe for an application to start publishing messages again. For connections that have a lot of queues/bindings/consumers to recover, it can be useful for applications to know this intermediary state and not have to wait for all of the subscription related entities to be fully recovered.

Types of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (correction or otherwise)
  • Cosmetics (whitespace, appearance)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask on the
mailing list. We're here to help! This is simply a reminder of what we are
going to look for before merging your code.

  • I have read the CONTRIBUTING.md document
  • I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
  • All tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in related repositories

Further Comments

If this is a relatively large or complex change, kick off the discussion by
explaining why you chose the solution you did and what alternatives you
considered, etc.

@@ -560,7 +560,10 @@ public void removeConsumerRecoveryListener(ConsumerRecoveryListener listener) {
}

private synchronized void beginAutomaticRecovery() throws InterruptedException {
this.wait(this.params.getRecoveryDelayHandler().getDelay(0));
final long delay = this.params.getRecoveryDelayHandler().getDelay(0);
if (delay > 0) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i had tried to use a backoff recovery delay handler that had an initial delay of 0 and quickly realized that recovery would hang forever here. An easy work around is to use a 1ms initial delay, but this feels like a better solution that may save someone else in the future.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is reasonable if you ask me.

@michaelklishin michaelklishin merged commit 43af65d into rabbitmq:master Feb 15, 2021
@michaelklishin
Copy link
Member

Thank you!

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

Successfully merging this pull request may close these issues.

None yet

3 participants