Make sure OnCallbackException is executed for AsyncConsumers#946
Make sure OnCallbackException is executed for AsyncConsumers#946michaelklishin merged 7 commits intorabbitmq:masterfrom
Conversation
…e. Previously, the wait called only if the job hasn't done yet. It lead to missing exception and missed the invoke of OnCallbackException event.
Checking manually for exceptions with task.Exception.
| object o = new object(); | ||
| bool notified = false; | ||
| string q = _model.QueueDeclare(); | ||
|
|
|
Are you sure the tests are testing the correct thing? If I debug them, I get the exception thrown by Also if I use the tests on master, they're green with or without your changes. |
|
@bollhals good catch. Honestly I was a bit lazy in reviewing the tests and mostly looked at the implementation side of things. Will take extra care next time (although I confess I was just about going on leave yesterday and I think that cause me to take shortcuts) |
|
Copied the tests from the sync version. The task.delay(0) is just to avoid warnings (async without await in the method). |
|
I did some quick tests regarding performance of this change
So the currently suggested change seems like the most promising one! |
Check the received exception in the test to verify it's the same.
|
Thank you for sticking with it @BarShavit! |
|
This one can and should probably go back into 6.x |
Make sure OnCallbackException is executed for AsyncConsumers (cherry picked from commit ef8eaf4)
|
Backported to |
Proposed Changes
Always call to await when executing a task in AsyncConsumerWorkService. Previously, the wait called only if the job hasn't done yet. It lead to missing exception and missed the invoke of OnCallbackException event.
Types of Changes
What types of changes does your code introduce to this project?
Put an
xin the boxes that applyChecklist
Put an
xin 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.mddocument