Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

System.TimeoutException: The operation has timed out. #1127

Closed
chsakell opened this issue Dec 19, 2021 · 2 comments
Closed

System.TimeoutException: The operation has timed out. #1127

chsakell opened this issue Dec 19, 2021 · 2 comments

Comments

@chsakell
Copy link

Hello,

We are getting System.TimeoutException: The operation has timed out. exceptions when using QueueBind or UnBindQueue methods. The issue happens only in high traffic hours in an ASP.NET Core SignalR 3.1 application hosted in linux containers - OpenShift.

Exception:

System.TimeoutException: The operation has timed out.
   at RabbitMQ.Util.BlockingCell`1.WaitForValue(TimeSpan timeout)
   at RabbitMQ.Client.Impl.SimpleBlockingRpcContinuation.GetReply(TimeSpan timeout)
   at RabbitMQ.Client.Impl.ModelBase.ModelRpc(MethodBase method, ContentHeaderBase header, Byte[] body)
   at RabbitMQ.Client.Framing.Impl.Model.QueueUnbind(String queue, String exchange, String routingKey, IDictionary`2 arguments)
   at RabbitMQ.Client.Impl.AutorecoveringModel.QueueUnbind(String queue, String exchange, String routingKey, IDictionary`2 arguments)
   at Customer.PushService.Infrastructure.RabbitMq.Bindings.RabbitMqCustomerBindingsService.UnBindQueue(String routingKey) 

When a user subscribes to a Signalr method, a binding is created in RabbitMQ.

private void BindQueue(string routingKey)
{
    using var model = _connection.CreateModel();
    model.QueueBind(queueName, exchangeName, routingKey, null);
}

At some point though during high volume, it seems that everything is just stopped, thread pool starvation is created and the above errors are shown.

image

Searching the code, it seems that it throws the exception in the BlockingCell WaitForValue method.

We don't have any memory leak or cpu issue on the ASP.NET Core app, so can you tell a reason why this happens?
Of course there's a lock statement in the ModelBase, and the GetReply is the one that throws the exception, but what does this actually mean? Is it possible that multiple concurrent requests to QueueBind or QueueUnBind cause this issue?

Thanks

@sungam3r
Copy link
Contributor

I think this problem has been already discussed before. See #860 and related issues with ThreadPool.SetMinThreads.

@michaelklishin
Copy link
Member

I will convert this issue to a GitHub discussion. Currently GitHub will automatically close and lock the issue even though your question will be transferred and responded to elsewhere. This is to let you know that we do not intend to ignore this but this is how the current GitHub conversion mechanism makes it seem for the users :(

@rabbitmq rabbitmq locked and limited conversation to collaborators Dec 20, 2021
@michaelklishin michaelklishin converted this issue into discussion #1128 Dec 20, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants