Skip to content

Handle realTag = 0 in RecoveryAwareChannelN #397

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

Merged
merged 1 commit into from
Aug 20, 2018

Conversation

caspermout
Copy link

@caspermout caspermout commented Aug 20, 2018

Proposed Changes

See #395

When a connection is lost and recovered, and the last message from the previous connection is acked with multi=true, the result is a basicAck with tag=0 and multi=1, this will ack every outstanding message.

This is a problem if there are messages that should be nacked. For example when the rabbit connection is lost, it would seem reasonable that other systems are also unreachable (like a database).
If it somehow happens that the last few messages in the previous connection are successful and acked with multi ack. Then the other unhandled messages will be acked as well.

This change makes sure that this does not happen and only sends a ack with multi=true and tag=0 when that is actually what is requested.

I did not create or run any tests because I am having trouble installing all the required dependencies.

Types of Changes

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

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

@pivotal-issuemaster
Copy link

@caspermout Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster
Copy link

@caspermout Thank you for signing the Contributor License Agreement!

Copy link
Contributor

@michaelklishin michaelklishin left a comment

Choose a reason for hiding this comment

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

Reviewed together with @acogoluegnes, we have some extra comments that will be added on top but the idea is sound.

Thank you!

@michaelklishin michaelklishin merged commit 2e6bf27 into rabbitmq:master Aug 20, 2018
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.

4 participants