rabbitmq / rabbitmq-dotnet-client

RabbitMQ .NET client for .NET Standard 2.0+ and .NET 4.6.2+
https://www.rabbitmq.com/dotnet.html
Other
2.07k stars 579 forks source link

Added a synchronous write loop for connections. #1389

Closed michac closed 1 year ago

michac commented 1 year ago

Proposed Changes

Add an option to make the WriteLoop in the SocketFrameHandler run in its own dedicated thread. In this version (6.x) most operations are blocking (CreateModel, QueueDeclare etc...) using BlockingCell. This can create a situation where all the threadpool threads are blocked waiting for a response to a message that can't get sent because there are no threads left for the WriteLoop. See #1354

Types of Changes

What types of changes does your code introduce to this project? Put an x in the boxes that apply

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.

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.

paulomorgado commented 1 year ago

Why should the RabbitMQ client account for application thread management?

The tread pool can be configured to accommodate the needs of the application.

lukebakken commented 1 year ago

Please see https://github.com/rabbitmq/rabbitmq-dotnet-client/pull/1392