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

Using a linked list for fast efficient tracking of [publisher confirm] delivery tags #836

Merged
merged 2 commits into from
May 19, 2020

Conversation

stebet
Copy link
Contributor

@stebet stebet commented May 14, 2020

Proposed Changes

This PR adds deliveryTag tracking using a linked list. Since the list and the delivery tags are only ever manipulated inside locks we can guarantee that the list contains unique values and is always sorted, making it a very fast way of keeping track of pending items. This is better than the original change I made where i stopped tracking individual tags and used separate counters, since now all delivery tags can be tracked which should make debugging easier in case of errors, now that the list is always available.

Also using a CountdownEvent do replace the Monitor.Pulse logic to signal when all delivery tags have been confirmed, simplifying code and reducing lock contention.

Types of Changes

  • 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

  • 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.

@lukebakken lukebakken self-assigned this May 14, 2020
@lukebakken lukebakken added this to the 6.1.0 milestone May 14, 2020
@michaelklishin michaelklishin changed the title Using a linked list for fast efficient tracking of delivery tags. Using a linked list for fast efficient tracking of [publisher confirm] delivery tags May 14, 2020
@michaelklishin
Copy link
Member

I like this idea. Please rebase this against master.

@stebet
Copy link
Contributor Author

stebet commented May 15, 2020

I like this idea. Please rebase this against master.

Done :)

@bording
Copy link
Collaborator

bording commented May 15, 2020

@stebet Technically, you didn't rebase the branch as asked, you merged master into your branch. Not the same thing! 😀

@stebet
Copy link
Contributor Author

stebet commented May 15, 2020

@stebet Technically, you didn't rebase the branch as asked, you merged master into your branch. Not the same thing! 😀

Gahhh you are right, my git-foo gets messed up sometimes. I'll see if I can fix it.

@michaelklishin
Copy link
Member

michaelklishin commented May 15, 2020 via email

@lukebakken lukebakken force-pushed the linkedListForDeliveryTags branch from 45a9d78 to d16050d Compare May 19, 2020 22:20
@lukebakken lukebakken merged commit ab614d9 into rabbitmq:master May 19, 2020
@stebet stebet deleted the linkedListForDeliveryTags branch May 20, 2020 00:04
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