Skip to content
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

Channel stays closed after connection has died #88

Closed
zlepper opened this issue Nov 17, 2021 · 0 comments · Fixed by #89
Closed

Channel stays closed after connection has died #88

zlepper opened this issue Nov 17, 2021 · 0 comments · Fixed by #89

Comments

@zlepper
Copy link
Contributor

zlepper commented Nov 17, 2021

I'm not 100% sure how to reliably reproduce this, without putting a computer to sleep for half a day.

But basically, if I have a program running that is using Rebus.RabbitMQ, and then put me computer to sleep, and come back the next day, all the RabbitMQ channels are in a "closed" state and refuse to be used.
The first set of exceptions looks like this:

 17/11/2021 07.54.41 Warning: An error occurred when attempting to receive the next message: Rebus.Exceptions.RebusApplicationException: Unexpected exception thrown while trying to dequeue a message from rabbitmq, queue address: ConfigurationManagementService
 ---> System.Threading.Channels.ChannelClosedException: The channel has been closed.
   at System.Threading.Channels.AsyncOperation`1.GetResult(Int16 token)
   at System.Threading.Channels.AsyncOperation`1.GetResult(Int16 token)
   at System.Threading.Channels.AsyncOperation`1.GetResult(Int16 token)
   at Rebus.RabbitMq.RabbitMqTransport.Receive(ITransactionContext context, CancellationToken cancellationToken)
   at Rebus.RabbitMq.RabbitMqTransport.Receive(ITransactionContext context, CancellationToken cancellationToken)
   at Rebus.RabbitMq.RabbitMqTransport.Receive(ITransactionContext context, CancellationToken cancellationToken)
   at Rebus.RabbitMq.RabbitMqTransport.Receive(ITransactionContext context, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at Rebus.RabbitMq.RabbitMqTransport.Receive(ITransactionContext context, CancellationToken cancellationToken)
   at Rebus.Workers.ThreadPoolBased.ThreadPoolWorker.ReceiveTransportMessage(CancellationToken token, ITransactionContext context)

Afterward each time Rebus tries to get new messages, it fails with a smaller version of that message:

17/11/2021 07.55.13 Warning: An error occurred when attempting to receive the next message: Rebus.Exceptions.RebusApplicationException: Unexpected exception thrown while trying to dequeue a message from rabbitmq, queue address: ConfigurationManagementService
 ---> System.Threading.Channels.ChannelClosedException: The channel has been closed.
   at Rebus.RabbitMq.RabbitMqTransport.Receive(ITransactionContext context, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at Rebus.RabbitMq.RabbitMqTransport.Receive(ITransactionContext context, CancellationToken cancellationToken)
   at Rebus.Workers.ThreadPoolBased.ThreadPoolWorker.ReceiveTransportMessage(CancellationToken token, ITransactionContext context)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant