WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

The Channel has been closed exception from HeartBeatReadCallback #1884

@patriktiain

Description

@patriktiain

Describe the bug

RabbitMQ client 7.2.0
RabbitMQ server 3.11

During one of our long running load tests, our application crashed during the night while we were rebuilding our SQL Server indexes. We have noticed during this rebuild, our application and RabbitMQ are performing worse regarding time to publish. Probably because of disc access on the server is reduced because of the index rebuild.

The application crashed, according to the Event viewer and the stack trace, because of a channel already closed exception from, what I can tell, the heartbeat read callback.

StackTrace:
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Threading.Channels.ChannelClosedException: The channel has been closed.
   at System.Threading.Channels.ChannelWriter`1.Complete(Exception error)
   at RabbitMQ.Client.Impl.Channel.OnSessionShutdownAsync(Object sender, ShutdownEventArgs reason)
   at RabbitMQ.Client.Impl.AsyncEventingWrapper`1.InternalInvoke(Delegate[] handlers, Object sender, TEvent event)
   at RabbitMQ.Client.Impl.AsyncEventingWrapper`1.InternalInvoke(Delegate[] handlers, Object sender, TEvent event)
   at RabbitMQ.Client.Impl.Channel.FinishCloseAsync(CancellationToken cancellationToken)
   at RabbitMQ.Client.Framing.Connection.FinishCloseAsync(CancellationToken cancellationToken)
   at RabbitMQ.Client.Framing.Connection.HeartbeatReadTimerCallback(Object state)
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.QueueUserWorkItemCallback.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()

To me it looks like an unhandled exception within the client library as there is no application reference in the stack trace.

I have observed this twice and it happened both times during the index rebuild.

Reproduction steps

1.High concurrent load
2.Increase contention on server by rebuilding SQL server index
3. Application crashed
...

Expected behavior

Channel closed exception should no cause application to crash.

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions