-
Notifications
You must be signed in to change notification settings - Fork 605
Ability to do concurrent dispatches both on the async as well as the sync consumer #866
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
Conversation
@stebet what do you think about this spike |
public AsyncConsumerWorkService(int concurrency) | ||
{ | ||
_concurrency = concurrency; | ||
_startNewWorkPoolFunc = model => StartNewWorkPool(model); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would introduce a capture of this
I'll take a look at this tomorrow :) |
projects/RabbitMQ.Client/client/impl/AsyncConsumerWorkService.cs
Outdated
Show resolved
Hide resolved
This looks good to me. I'm wondering if it'd be better to default AsyncConsumerConcurrency to Environment.ProcessorCount if it's enabled. That'd mean two properties though, AsyncConsumerConcurrencyEnabled (false when AsyncConsumerConcurrencyCount == 1, when set to true, would set AsyncConsumerConcurrencyCount = Environment.ProcessorCount if AsyncConsumerConcurrencyCount == 1). Maybe that's just making things a bit convoluted perhaps... what do you think? |
My thought process was that |
162e193
to
fbbbeba
Compare
4f837c4
to
9a314fa
Compare
9a314fa
to
1cee677
Compare
I've pushed a few changes to the tests to make them more reliable. |
@michaelklishin @lukebakken any thoughts? This could go in 6.2 if you guys are willing to take it |
I've been busy with other work. I'll try to get to this PR today. We have some bug fixes that are planned for |
No stress @lukebakken |
Thanks @danielmarbach and @stebet for the review. |
Ability to do concurrent dispatches both on the async as well as the sync consumer (cherry picked from commit 05d0930)
@lukebakken where should we track whether this new property should be moved to the interface or not? I did deliberately not add it there to not add a breaking change. Ideally an issue that is added to the next major version with a breaking change label would be awesome |
@danielmarbach we can create a new issue for that. I'm mid-review / testing of #868 / #878 right now 😄 |
Have |
Do you have a repro you can share? Would love to dig into if this is still a problem. BasicAck and BasicNack are IModel operations, and it is not supported to share the same IModel instance between threads. |
I'd be interested to see and hear this as well. We are doing |
@shaneqld @danielmarbach @stebet concurrent acknowledgments of single deliveries are safe. Acknowledgments with So I don't see how this approach changes anything for |
BTW how can I contribute to the doco for the new feature I added. I don't want you guys to need to do all the grunt workAm 25.06.2020 17:49 schrieb Michael Klishin <notifications@github.com>:
@shaneqld @danielmarbach @stebet concurrent acknowledgments of single deliveries are safe. Acknowledgments with multiple set to true can indeed cause protocol channel exceptions. But this can happen even with a single thread of execution. This is also not a novel problem, although I see that our doc section on concurrency of consumers does not cover this very well.
So I don't see how this approach changes anything for basic.ack and basic.{nack,reject} operations.
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.
|
I ran into this in a previous version with a different implementation of concurrency, but have been unable to reproduce in this latest version. When I have a moment I will update a project that has this workaround for the protocol error (and remove said workaround) and let you know if I run into any issues. |
Proposed Changes
An alternative to #806
If the interface is not extended then this can be added in a non breaking way on the level of the connection factory and later could be propagated to the interfaces in v7. I currently named the property
ProcessingConcurrency
to convey the intent for both the sync and the async caseTypes of Changes
What types of changes does your code introduce to this project?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creatingthe 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.
CONTRIBUTING.md
documentFurther 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.