System.NotSupportedException. Pipelining of requests forbidden after timeout
pabermod opened this issue · comments
Describe the bug
Hi,
If a timeout is produced when trying to declare a queue using the method QueueDeclare
, following attempts to define a queue using the same IModel
will produce a System.NotSupportedException. Pipelining of requests forbidden after timeout error.
Also if I try to dispose a IConnection
that was unexpectedly closed, the Dispose method seems to never return.
To simulate timeout I use the windows application clumsy version 0.3 with the following configuration
I attach an example client:
RabbitMQTimeout.zip
Reproduction steps
- Start rabbitmq in a docker env:
docker run --hostname my-rabbit --name some-rabbit -p 15672:15672 -p 5672:5672 rabbitmq:3-management
- Open clumsy and configurate as indicated
- Start the attached project
- When the message "Channel MyChannel9 opened in connection 'MyClient'" is printed, start clumsy
- A timeout exception will appear when trying to create one of the queues
- Following exceptions will be System.NotSupportedException. Pipelining of requests forbidden
- Also after a while the connection will be unexpectedly closed with message: 541 - Unexpected Exception
Expected behavior
After the first timeout the channel should be created if there are no more connectivity problems. Otherwise it should generate again a Timeout exception.
Also the IConnection
should be able to be manually disposed after an unexpected error. The line 232 of class RabbitMQCore is never executed.
Additional context
No response
It's not clear from your description whether the client actually hits an operation timeout or not. Because if it does not, then the exception is correct: this client does not support pipelining of methods for which the server will send a response.
Hi,
Yes, the client will get a timeout when trying to create a queue. After that it will get a Pipelining of requests forbidden after timeout exception. each time I try to create a queue using that channel.
If I stop clumsy while getting the exceptions "Pipelining of requests forbidden" it will finally create the queue.
So for me is an strange error that cannot be understad by the user.
From the error message i would understand that after a timeout I cannot use the channel anymore. But if the network problem disappears it can create finally the queue using that same Channel, so i'm seeing some kind of inconsistency.
@pabermod I added your code here - https://github.com/lukebakken/rabbitmq-dotnet-client-1368
I can reproduce this issue using more aggressive settings in Clumsy. I'm investigating.
Yes, the client will get a timeout when trying to create a queue
Any exception on a channel essentially means that IModel
/ IChannel
instance is no longer valid and should be disposed.
In this specific case, I can see some improvements to be made:
- The libarary throws
System.TimeoutException
but a client-library exception is the correct behavior (#1439) - Client exceptions could include the associate connection and channel as exception data.
I don't think this issue should be addressed in the 6.x series of this library, which is why I moved it to the 7.0.0 milestone
#402 is this same issue.