WebSocketServiceManager.Broadcast() gets stuck if one of clients stops reading from socket
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.1k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
Problem description:
One of our web socket clients for some reason stopped receiving messages(Some bug in our client code). This stopped message delivery to all other clients. After investigating this issue we saw that WebSocketServiceManager.Broadcast() got stuck on delivery to that buggy client for 5+ hours.
Steps to reproduce:
- Start WebSocketServer
- Connect to WebSocket from client(without Receive)
- Start loop with WebSocketServiceManager.Broadcast(/1KB/) with 10000 iterations
Actual result:
WebSocketServiceManager.Broadcast() got stuck on 172th iteration
Expected result:
Loop should complete successfully
Proposed solution:
Add property WebSocket.SendTimeout to limit sending message into socket.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at WebSocketServiceManager.Broadcast() and reproduce the issue with a client that does not receive messages, using the 1KB payload and 10,000 iterations described here. Done means a stalled client no longer prevents the broadcast loop from completing, with the sending behavior covered by a reproducible check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100