Unknown disconnect happened and "ThrowInvalidOperationException_BackpressureDeadlock"
See original GitHub issueDescribe the bug
When I send several small message from signalr client to signalr hub,sometimes will raise a disconnect event. Message package is very small: 40B more or less , one per millisecond . The hub side do some time-consuming operations, 2 second in one message process operation。
When disconnect happened, the exception is null:2019-05-31 22:06:36,494 [6] DEBUG (null) CoordServer.Hubs.ServerHub >>> OnDisconnectedAsync Start, exception: (null)
or :2019-05-31 22:13:40,699 [23] ERROR (null) Microsoft.AspNetCore.SignalR.HubConnectionHandler >>> Error when processing requests. System.InvalidOperationException: Advancing examined to the end would cause pipe to deadlock because FlushAsync is waiting. at System.IO.Pipelines.ThrowHelper.ThrowInvalidOperationException_BackpressureDeadlock() at System.IO.Pipelines.Pipe.AdvanceReader(BufferSegment consumedSegment, Int32 consumedIndex, BufferSegment examinedSegment, Int32 examinedIndex) at System.IO.Pipelines.Pipe.AdvanceReader(SequencePosition& consumed, SequencePosition& examined) at System.IO.Pipelines.Pipe.DefaultPipeReader.AdvanceTo(SequencePosition consumed, SequencePosition examined) at Microsoft.AspNetCore.SignalR.HubConnectionHandler1.DispatchMessagesAsync(HubConnectionContext connection)
at Microsoft.AspNetCore.SignalR.HubConnectionHandler1.RunHubAsync(HubConnectionContext connection).
From these links , I thought it maybe something about the size of ApplicationMaxBufferSize , but
Today SignalR needs to buffer the entire message before it calls your hub and it doesn’t start consuming the buffer until it seems an entire message.
In my program, the message size is so small, why I still met this error? Any helps? Thanks!
Additional context
Microsoft.AspNetCore.SignalR.Client 1.1.0 Microsoft.NETCore.App 2.2.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (8 by maintainers)

Top Related StackOverflow Question
Yes, this exception has been removed completely from 3.0.
We no longer throw this error in 3.0. There is still a maximum message size, but it is configurable (and docs will be updated).