You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Production code using sockets is experiencing hangs requiring forced terminations. The pattern is a server able to send significant stream data, combined with a client that reacts to the data, which takes a little bit of time, and replies. Therefore the server gets ahead of the client and data starts to accumulate in the socket buffers.
What did you see happen?
After attaching some diagnostics, it is observed a net connection Write call isn't returning. It's permanently stuck.
A repro program is provided in this repository. See the readme for repro instructions.
What did you expect to see?
Write completes its task. If the buffer was too full, Write may block initially but should eventually unblock as the client progresses through the stream.
The text was updated successfully, but these errors were encountered:
Uncovered that the Write will unblock after waiting long enough. In the repro program it will wait for an entire 1MB to drain before resuming. If the client takes many minutes (or hours in my case) to process 1MB of messages, this will look like a hang. There does not seem to be a way to control this behavior.
Go version
go version go1.22.1 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Production code using sockets is experiencing hangs requiring forced terminations. The pattern is a server able to send significant stream data, combined with a client that reacts to the data, which takes a little bit of time, and replies. Therefore the server gets ahead of the client and data starts to accumulate in the socket buffers.
What did you see happen?
After attaching some diagnostics, it is observed a net connection
Write
call isn't returning. It's permanently stuck.A repro program is provided in this repository. See the readme for repro instructions.
What did you expect to see?
Write
completes its task. If the buffer was too full,Write
may block initially but should eventually unblock as the client progresses through the stream.The text was updated successfully, but these errors were encountered: