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

Async flow control #1681

Merged
merged 11 commits into from
Sep 18, 2024
Merged

Async flow control #1681

merged 11 commits into from
Sep 18, 2024

Conversation

danielmarbach
Copy link
Collaborator

@danielmarbach danielmarbach commented Sep 18, 2024

Proposed Changes

Addresses #1644

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.

@danielmarbach danielmarbach changed the title Reset event Async flow control Sep 18, 2024
@danielmarbach
Copy link
Collaborator Author

@stebet @bollhals @paulomorgado would appreciate a look since this is some non trivial magic.

lukebakken
lukebakken previously approved these changes Sep 18, 2024
Copy link
Contributor

@lukebakken lukebakken left a comment

Choose a reason for hiding this comment

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

Thank you @danielmarbach

@lukebakken
Copy link
Contributor

Should we worry about the scenario where flow control is active and a publisher just keeps on going? I'm assuming this will "pile up" tasks/continuations/"under the hood magic" behind the scenes. Should there be a limit to the number of publishes that can happen while blocked by flow control?

@danielmarbach
Copy link
Collaborator Author

Should we worry about the scenario where flow control is active and a publisher just keeps on going? I'm assuming this will "pile up" tasks/continuations/"under the hood magic" behind the scenes. Should there be a limit to the number of publishes that can happen while blocked by flow control?

Assuming this is actually a problem that requires to be solved isn't this already an issue before this change?

@danielmarbach
Copy link
Collaborator Author

With these changes in we will have also the door open to implement IAsyncDisposable across both TFMs.

@lukebakken
Copy link
Contributor

Assuming this is actually a problem that requires to be solved isn't this already an issue before this change?

Ah, ok, this will only be a problem if someone is not immediately await-ing the BasicPublishAsync result, and batching them up. I guess it's on the user in that case 😉

@danielmarbach
Copy link
Collaborator Author

FYI I did not setup the commit signing on my temporary device while my main macbook is on repair. When I rebased on my temporary device the commit signing got lost

@lukebakken
Copy link
Contributor

No worries, I'm not too worried about anyone doing an xz-utils-style exploit via this library 😉 😆

@lukebakken lukebakken merged commit 317945c into rabbitmq:main Sep 18, 2024
11 checks passed
@danielmarbach danielmarbach deleted the reset-event branch September 18, 2024 20:59
@lukebakken lukebakken added this to the 7.0.0 milestone Sep 19, 2024
@bollhals
Copy link
Contributor

@stebet @bollhals @paulomorgado would appreciate a look since this is some non trivial magic.

Looks good to me, but since I'm currently on vacation, it's a bit difficult to judge the new class. Is it inspired from somewhere? I think I only used a similar class once so far.

@danielmarbach
Copy link
Collaborator Author

danielmarbach commented Sep 20, 2024

@bollhals I took the original version from Stephen's blog post b52c3d1 and modernized it a bit according to my best knowledge

Enjoy your vacation!

@bollhals
Copy link
Contributor

Then I the implementation will be good 👍🏼

@danielmarbach
Copy link
Collaborator Author

Having here in the PR is more then enough especially considering the implementation I provided is significantly different due to modernizations applied

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.

5 participants