Files
mlsad3 fd820380a6 Fix head-of-line blocking and resource leak in BidirectionalRelay (#713)
- Closes #712.
- Replace synchronous `write()` calls in
  `BidirectionalRelay` with non-blocking I/O
  and `DispatchSourceWrite` backpressure
  handling. Under concurrent vsock proxy load,
  a single blocked write on the shared serial
  dispatch queue would freeze all relay
  connections permanently, including unrelated
  new connections.
- Set relay file descriptors to `O_NONBLOCK`
  and handle `EAGAIN` by suspending reads and
  installing a write source to drain pending data.
- Give each `BidirectionalRelay` its own serial queue
  instead of sharing one from `UnixSocketRelayManager`,
  eliminating cross-connection blocking.
- Resume suspended read sources before cancelling
  in `stop()` — GCD does not deliver cancel handlers
  on suspended dispatch sources, which caused file
  descriptor and memory leaks on teardown under
  backpressure.
- Guard-unwrap `buf.baseAddress` in
  `drainPendingWrite`.
2026-06-01 10:33:36 -07:00
..