8000 Don't get stuck on index key with no messages by gomoripeti · Pull Request #214 · rabbitmq/rabbitmq-delayed-message-exchange · GitHub
[go: up one dir, main page]

Skip to content

Don't get stuck on index key with no messages #214

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
Jan 24, 2023

Conversation

gomoripeti
Copy link
Contributor

Proposed Changes

When the delayed_message gen_server encounters the next timestamp in the index table and there are no messages in the main table associated, it would loop forever, as this timestamp will stay the "first" key in the index table.

This commit makes sure the expired index entry gets deleted even if there are no associated messages.

This situation can happen if the node is abruptly stopped in the middle of delaying a messsage (after writing to the index table but before writing to the main table).

Types of Changes

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

  • Bug fix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause an observable behavior change in existing systems)
  • Documentation improvements (corrections, new content, etc)
  • Cosmetic change (whitespace, formatting, etc)

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.

When the delayed_message gen_server encounters the next timestamp in the
index table and there are no messages in the main table associated, it
would loop forever, as this timestamp will stay the "first" key in the
index table.

This commit makes sure the expired index entry gets deleted even if
there are no associated messages.

This situation can happen if the node is abruptly stopped in the middle
of delaying a messsage (after writing to the index table but before
writing to the main table).
@michaelklishin michaelklishin merged commit ebfb744 into rabbitmq:main Jan 24, 2023
@michaelklishin
Copy link
Contributor

Thank you. I will cut a new release later today or tomorrow.

@gomoripeti
Copy link
Contributor Author

Thanks Michael. I have a few more small improvement branches (no bugs) if you could wait a few days to include them also in the release.
Btw would it be possible to backport these and create releases for 3.9.x and 3.10.x as well as 3.11.x? (I think these releases are very similar apart from which RabbitMQ version they require)

@gomoripeti gomoripeti deleted the empty_index branch January 24, 2023 23:09
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
0