Fix CloseMessage issues #34294
Labels
area-signalr
Includes: SignalR clients and servers
enhancement
This issue represents an ask for new feature or an enhancement to an existing one
The main issue is that
CloseMessage
is written to the pipe and then the app task exits, then connection cleanup starts which will complete the transport pipes, this results in a race where theCloseMessage
might not get sent if there was any backpressure or thread scheduling was unfavorable for the pipe dispatches.Additionally, there are scenarios where we would like to specify the reason for closing the connection and it is non-trivial to do that, so we should make it easier.
Potential solutions:
Wait a little after sending the close message to give it time to send
Somehow detect that the close message is sent before completing the app task (with timeout of course)
The text was updated successfully, but these errors were encountered: