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

Sequence Number non-blocking #1675

Merged
merged 2 commits into from
Sep 17, 2024
Merged

Conversation

danielmarbach
Copy link
Collaborator

Proposed Changes

Follow through on #1662

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.

@lukebakken lukebakken self-requested a review September 13, 2024 16:00
@lukebakken lukebakken self-assigned this Sep 13, 2024
@lukebakken lukebakken added this to the 7.0.0 milestone Sep 13, 2024
@lukebakken
Copy link
Contributor

@danielmarbach if you have time to review my commit, that would be great. I figure now would be the time to make the event handlers for basic.ack, basic.nack and basic.return async as well.

This PR has a positive effect on the performance of the PublisherConfirms test application!

@danielmarbach
Copy link
Collaborator Author

I see what I can do over the weekend

@lukebakken
Copy link
Contributor

Thanks, but don't worry about it until next week, really 😄 I've bumped the "hopeful" shipping date for v7 to the 20th.

@danielmarbach
Copy link
Collaborator Author

danielmarbach commented Sep 16, 2024

@lukebakken I reviewed it and basically that change opened a whole can of worms.

When I looked at the change, I started wondering why there are synchronous and non-synchronous event handlers and exception handlers now on the channel interface and wondered whether it makes sense to make them all async. This lead me then down the path or realizing the internal session interface event might also need to change which then has ripple effects on the connection events as well.

I think the change you pushed is unrelated to this PR and it is better to roll that commit back and have a dedicated follow-up PR (should you decide to continue pushing down that route).

A bunch of thoughts I had during the review of the changes:

  • Why CallbackException and CallbackExceptionAsync. This is confusing and should be unified
  • Why no FlowControlAsync, ChannelShutdown and RevoveryAsync
  • TakeOver method seems not consistently implemented
  • _callbackExceptionAsyncWrapper is not initialized
  • Why is there no SessionShutdownAsync and corresponding CloseAsync nor NotifyAsync
  • Why doesn't the connection provide event overloads? Assuming the API surface is async everywhere, it seems users of the client might do something async there too which requires them to do sync over async.
  • Why are the Async Event Args not supporting a cancellation token similar to https://learn.microsoft.com/en-us/dotnet/api/azure.syncasynceventargs?view=azure-dotnet
  • Why is the connection not supporting IAsyncDisposable?

To me, the API surface feels unfinished

@lukebakken
Copy link
Contributor

Sure, I can revert it. I tried making all event handlers async a while back and it just plain didn't work.

@paulomorgado
Copy link
Contributor

Sure, I can revert it. I tried making all event handlers async a while back and it just plain didn't work.

For async event handlers, you have to manually invoke and await every delegate in the invocation list. But it works.

@danielmarbach
Copy link
Collaborator Author

@paulomorgado That's already solved in the AsyncEventHandler and the AsyncEventHandlerWrapper in the code. It is just not followed through yet entirely. I'm happy to help out to address some of the comments I made above in another PR

@paulomorgado
Copy link
Contributor

@paulomorgado That's already solved in the AsyncEventHandler and the AsyncEventHandlerWrapper in the code. It is just not followed through yet entirely. I'm happy to help out to address some of the comments I made above in another PR

The IAsyncDisposable should be fairly easy.

@lukebakken
Copy link
Contributor

I will merge this as CI passes. We can deal with async events in a later version of this library (or, wait until someone demonstrates a need). Thanks everyone.

@lukebakken lukebakken merged commit b6b400d into rabbitmq:main Sep 17, 2024
19 of 20 checks passed
@lukebakken
Copy link
Contributor

Thank you @danielmarbach !!!

This was referenced Sep 18, 2024
@danielmarbach danielmarbach deleted the channel-base branch September 18, 2024 17:40
@danielmarbach danielmarbach mentioned this pull request Sep 19, 2024
11 tasks
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.

3 participants