mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Close two wire-closure terminality gaps in the permission broker's ask surface. Writer flush failure is now connection-fatal. A blocking stdout can report Ok from write_all when it only schedules the underlying write and surface the real error at flush; the writer previously discarded that flush error and kept waiting on its receiver, so a genuinely dead stdout left the writer alive, the async_main writer-death arm never fired, and an accepted ask stayed resident until its deadline. write_frames (extracted, generic over its AsyncWrite sink for tests) now returns on either write_all or flush error, dropping the receiver so the connection supervisor cancels every session. Permission enqueue is now the third phase governed by the single absolute deadline. request_permission previously bare-awaited send_checked after registering the entry; a full-but-live channel makes that await wait for capacity, racing neither cancellation nor the deadline, so a stalled writer could hold the ask and its global permit past the advertised deadline and session/cancel could not resolve it. The send now runs in the same biased select as admission and response: cancel wins Cancelled, the shared deadline wins the timeout deny, send error stays the wire-closed deny. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>