I have done the following
Steps to reproduce
- Run an application that opens many simultaneous socket connections through the
UnixSocketRelay vsock proxy (e.g., multiple concurrent operations that stress the proxy heavily)
- Generate enough concurrent traffic that at least one destination file descriptor's write buffer fills up
- Attempt any new operation through the proxy (e.g., a simple status check)
The hang is reliably reproducible by launching 5+ concurrent container operations simultaneously. Once triggered, the proxy never recovers — all existing and new connections hang indefinitely until the process is restarted.
Current behavior
The entire vsock proxy becomes permanently unresponsive. All connections — including completely unrelated new ones — hang indefinitely. The process must be fully restarted to recover.
Root cause: BidirectionalRelay uses synchronous write() calls on a shared serial DispatchQueue (com.apple.containerization.socket-relay). When a destination fd's buffer fills (remote end temporarily busy), the write() blocks the serial queue. Since all relay connections share this queue, a single blocked write freezes every connection.
Secondary issue: When a relay is torn down while under backpressure (read source suspended), stop() calls cancel() on the suspended DispatchSourceRead. GCD does not deliver cancel handlers on suspended dispatch sources, so file descriptors leak and waitForCompletion() never resolves.
Expected behavior
When one connection's destination buffer is full, only that connection should stall. All other relay connections should continue operating normally. When backpressure clears, the stalled connection should resume without intervention.
Environment
- OS: macOS 26.x (Tahoe)
- Xcode: 26.4
- Swift: 6.3
Relevant log output
Code of Conduct
I have done the following
Steps to reproduce
UnixSocketRelayvsock proxy (e.g., multiple concurrent operations that stress the proxy heavily)The hang is reliably reproducible by launching 5+ concurrent container operations simultaneously. Once triggered, the proxy never recovers — all existing and new connections hang indefinitely until the process is restarted.
Current behavior
The entire vsock proxy becomes permanently unresponsive. All connections — including completely unrelated new ones — hang indefinitely. The process must be fully restarted to recover.
Root cause:
BidirectionalRelayuses synchronouswrite()calls on a shared serialDispatchQueue(com.apple.containerization.socket-relay). When a destination fd's buffer fills (remote end temporarily busy), thewrite()blocks the serial queue. Since all relay connections share this queue, a single blocked write freezes every connection.Secondary issue: When a relay is torn down while under backpressure (read source suspended),
stop()callscancel()on the suspendedDispatchSourceRead. GCD does not deliver cancel handlers on suspended dispatch sources, so file descriptors leak andwaitForCompletion()never resolves.Expected behavior
When one connection's destination buffer is full, only that connection should stall. All other relay connections should continue operating normally. When backpressure clears, the stalled connection should resume without intervention.
Environment
Relevant log output
Code of Conduct