A QUIC zone transfer completes when the primary closes its stream before reading the client's end of stream #350

Closed
opened 2026-11-06 14:24:12 -05:00 by claude · 0 comments
Owner
  • Draft: none (found while verifying #278, 2026-11-06)
  • Priority: low
  • Agent: protocol-coder
  • Depends on: #278
  • Decisions: none

Why

QuicZoneTransferClient.PullAsync sends its end of stream with WriteAsync(..., completeWrites: true) after the query (around lines 150-160 of QuicZoneTransferClient.cs).

  • A primary that answers and then closes or aborts its stream without reading to the client's end of stream makes that write throw QuicException ("Stream aborted by peer"), even though the full answer arrived.
  • The exception escapes to SecondaryZoneRefreshService, whose catch-all logs "Unhandled exception while checking secondary zones", and the transfer is retried.
  • Ninlil's own DoQ listener reads to the end of stream, so this only shows against other primaries. The #278 test fake was changed to read to the client's end of stream, so the tests no longer show it.

What changes

  • The client tolerates a failed end-of-stream write when the response can still be read in full, and does not fail a transfer that completed.
  • A real failure (no or incomplete answer) is still reported.
  • A test drives a fake primary that answers and closes its stream without reading the client's end of stream (red first).

Acceptance

  • The new test fails before and passes after; Ninlil.Dns.Server.Authoritative.Tests passes on Linux and on Lofnheim.
  • A CHANGELOG line under Unreleased.
- **Draft:** none (found while verifying #278, 2026-11-06) - **Priority:** low - **Agent:** protocol-coder - **Depends on:** #278 - **Decisions:** none ### Why `QuicZoneTransferClient.PullAsync` sends its end of stream with `WriteAsync(..., completeWrites: true)` after the query (around lines 150-160 of `QuicZoneTransferClient.cs`). - A primary that answers and then closes or aborts its stream without reading to the client's end of stream makes that write throw `QuicException` ("Stream aborted by peer"), even though the full answer arrived. - The exception escapes to `SecondaryZoneRefreshService`, whose catch-all logs "Unhandled exception while checking secondary zones", and the transfer is retried. - Ninlil's own DoQ listener reads to the end of stream, so this only shows against other primaries. The #278 test fake was changed to read to the client's end of stream, so the tests no longer show it. ### What changes - The client tolerates a failed end-of-stream write when the response can still be read in full, and does not fail a transfer that completed. - A real failure (no or incomplete answer) is still reported. - A test drives a fake primary that answers and closes its stream without reading the client's end of stream (red first). ### Acceptance - [ ] The new test fails before and passes after; `Ninlil.Dns.Server.Authoritative.Tests` passes on Linux and on Lofnheim. - [ ] A CHANGELOG line under Unreleased.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
lantea-one/ninlil#350
No description provided.