-
Notifications
You must be signed in to change notification settings - Fork 607
OperationInterruptedException or TaskCanceledException at startup #1827
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
Comments
Some questions:
The above exception could happen if this library receives the result of an RPC operation from RabbitMQ after the Task that is waiting for that result times out (continuation timeout). Though, I wouldn't expect to see this when opening a channel. The other
You should check the status of the When you call a method like This does all seem to be the result of a very slow environment. The |
Sorry, for missing information:
While it does not look like slow startup.. probably it depends on internal cancellation token timeout. How long it is?
Yes - that one is cancelled, but I its not mine :D As you mentioned - probably its the one created internally by RabbitMQ.Client. |
No, what does RabbitMQ log when these exceptions occur, if anything?
It is set by
The test suite uses this technique to output logs that originate via |
Its a bit hard to find out what's on RabbitMQ server, as we have really a lot of clients. |
@lukebakken, I think I got the same error:
And here is RMQ log messages at a time exception occur: RabbitMQ.Client version is 7.1.2 If you'll need anything else -- let me know, I'll try to provide as much information as you need. Hope this will help to fix the issue. |
Describe the bug
I have an application running under IIS. Its one of many in our microservices architecture. But this one seems to be having issues at startup when consumers are not created.
So far I was able to identify 2 exceptions which are happening somewhere inside RabbitMQ.Client (or in whatever place).
What my application does at startup:
However one service gets TaskCanceledException at random code places, sometimes inside ExchangeDeclareAsync, sometimes inside QueueDeclareAsync, sometimes inside QosAsync, basically in any of async methods which is part of RabbitMQ.Client.
I double checked - the cancellation token which I pass to these methods remains uncancelled.
Here is example stack trace:
Sometimes in a bit more rare situations I get another exception like:
The last one seems like a multithreading issue. However I double checked - I have await in every code part here, so whole code is executed sequentially and awaited until completes.
Behavior can be quite reliably replicated during deployment to the server, but I was not able to reproduce it on my local machine or other developers machines. Machine which is deployed is also on slower ones, which might suggest some timing, thread waiting issues or whatever.
However maybe that OperationInterruptedException can get you some clues - how this can happen and how it can be fixed?
Channels are not reused between threads in app. There are around 32 consumers created (and also about 32 channels - one for each consumer). I am also made sure that application is not stopping just after start.. so its something else which cancelling thread.
Reproduction steps
Not able to reproduce on any other machine except one server.
Expected behavior
Exception should not happen.
Additional context
No response
The text was updated successfully, but these errors were encountered: