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

Merged
claude merged 3 commits from feature/350-quic-transfer-end-of-stream into develop 2026-11-13 00:58:38 -05:00
Owner

A QUIC zone transfer now completes when the primary answers and closes its stream before it has read the secondary's end of stream.

  • Cause: QuicZoneTransferClient.PullAsync sent its end of stream (RFC 9250 §4.2) without tolerating a failure. A primary that stops reading sends STOP_SENDING (RFC 9000 §3.5), the write threw QuicException, and the transfer failed although the whole answer had arrived.
  • Fix: the end-of-stream write is always attempted and only its failure is tolerated (logged at Debug); the query is already written and the response read decides. A missing or incomplete answer is still a failed pull: success needs the closing SOA.
  • Also: a QuicException while reading the response is returned as a failed pull. It used to escape to the refresh service's catch-all, which logged "Unhandled exception" and abandoned the rest of that batch of zones.
  • Test seam: OnQueryWrittenAsync is an internal virtual no-op the tests override through InternalsVisibleTo to hold the end of stream back until STOP_SENDING has arrived; without it the race cannot be produced. It adds nothing to the package's public API.
  • CHANGELOG entry under ## Unreleased.

Verified

  • Red/green: with only the production fix reverted, the three new tests fail with QuicException: Stream aborted by peer; with it they pass. Ninlil.Dns.Server.Authoritative.Tests 674 of 674 on Linux; build 0 warnings; csharpier clean on the changed folders.
  • Windows (lofnheim): the QUIC transfer tests pass 6 of 6 on real QUIC.
  • Verifier: accepted; its findings (a 30-second test that did not test what it said, the seam as public API, a loose comment) are fixed in the second commit. The second commit was checked by the coordinating session's Windows run and the coder's Linux run, not by a second verifier pass.

Closes #350

🤖 Generated with Claude Code

https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK

A QUIC zone transfer now completes when the primary answers and closes its stream before it has read the secondary's end of stream. - **Cause:** `QuicZoneTransferClient.PullAsync` sent its end of stream (RFC 9250 §4.2) without tolerating a failure. A primary that stops reading sends STOP_SENDING (RFC 9000 §3.5), the write threw `QuicException`, and the transfer failed although the whole answer had arrived. - **Fix:** the end-of-stream write is always attempted and only its failure is tolerated (logged at Debug); the query is already written and the response read decides. A missing or incomplete answer is still a failed pull: success needs the closing SOA. - **Also:** a `QuicException` while reading the response is returned as a failed pull. It used to escape to the refresh service's catch-all, which logged "Unhandled exception" and abandoned the rest of that batch of zones. - **Test seam:** `OnQueryWrittenAsync` is an `internal virtual` no-op the tests override through `InternalsVisibleTo` to hold the end of stream back until STOP_SENDING has arrived; without it the race cannot be produced. It adds nothing to the package's public API. - CHANGELOG entry under `## Unreleased`. **Verified** - Red/green: with only the production fix reverted, the three new tests fail with `QuicException: Stream aborted by peer`; with it they pass. `Ninlil.Dns.Server.Authoritative.Tests` 674 of 674 on Linux; build 0 warnings; csharpier clean on the changed folders. - Windows (lofnheim): the QUIC transfer tests pass 6 of 6 on real QUIC. - Verifier: accepted; its findings (a 30-second test that did not test what it said, the seam as public API, a loose comment) are fixed in the second commit. The second commit was checked by the coordinating session's Windows run and the coder's Linux run, not by a second verifier pass. Closes #350 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Refs #350

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
The QUIC transfer client's test hook is internal and its no-answer tests end at once instead of waiting for the read timeout
Some checks failed
Build / Build Binary (macos-arm64) (push) Has been skipped
Build / Smoke Test the Windows Binary (push) Has been skipped
Build / Build Binary (windows-amd64) (push) Has been skipped
Build / Build Arch Linux Packages (push) Has been skipped
Build / Build and Test Deb and RPM Packages (push) Has been skipped
Build / Build and Push Image (push) Has been skipped
Build / Publish Release (push) Has been skipped
Build / Pipeline (push) Failing after 0s
Build / Test .NET on Windows (pull_request) Has been skipped
Build / Compute Version (pull_request) Successful in -2m33s
Build / Lint and Script Tests (pull_request) Successful in -1m54s
Build / Test Admin Console (pull_request) Successful in -48s
Build / Windows Test Gate (pull_request) Successful in -2m38s
Build / Test .NET (pull_request) Successful in 4m31s
Build / Stage Draft Release (pull_request) Successful in -2m36s
Build / Pack and Push NuGet Packages (dhcp) (pull_request) Successful in -2m9s
Build / Pack and Push NuGet Packages (dns-core) (pull_request) Successful in -2m6s
Build / Pack and Push NuGet Packages (common) (pull_request) Successful in -2m27s
Build / Pack and Push NuGet Packages (dns-server) (pull_request) Successful in -2m5s
Build / Build Binary (linux-arm64) (pull_request) Successful in -35s
Build / Build Binary (linux-amd64) (pull_request) Successful in -15s
Build / Build Binary (macos-amd64) (pull_request) Successful in -1m5s
Build / Build Binary (macos-arm64) (pull_request) Successful in -1m6s
Build / Build Binary (windows-amd64) (pull_request) Successful in -58s
Build / Smoke Test the Windows Binary (pull_request) Successful in 15s
Build / Build Arch Linux Packages (pull_request) Successful in -1m43s
Build / Build and Push Image (pull_request) Successful in -2m32s
Build / Build and Test Deb and RPM Packages (pull_request) Successful in 1m10s
Build / Publish Release (pull_request) Successful in -2m34s
Build / Pipeline (pull_request) Successful in 0s
db94f03069
Closes #350

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
The QUIC transfer branch takes in develop and keeps both unreleased changelog entries
All checks were successful
Build / Test .NET (pull_request) Successful in 3m43s
Build / Pack and Push NuGet Packages (dns-server) (push) Successful in -2m6s
Build / Windows Test Gate (pull_request) Successful in -2m38s
Build / Build Binary (linux-amd64) (push) Successful in -25s
Build / Build Binary (linux-arm64) (push) Successful in -1m6s
Build / Build Binary (macos-amd64) (push) Successful in -1m8s
Build / Build Binary (macos-arm64) (push) Successful in -1m9s
Build / Stage Draft Release (pull_request) Successful in -2m36s
Build / Build Binary (windows-amd64) (push) Successful in -1m9s
Build / Pack and Push NuGet Packages (common) (pull_request) Successful in -2m28s
Build / Smoke Test the Windows Binary (push) Successful in 15s
Build / Pack and Push NuGet Packages (dhcp) (pull_request) Successful in -2m16s
Build / Pack and Push NuGet Packages (dns-core) (pull_request) Successful in -2m10s
Build / Pack and Push NuGet Packages (dns-server) (pull_request) Successful in -2m4s
Build / Build Arch Linux Packages (push) Successful in -2m21s
Build / Build and Push Image (push) Successful in -2m0s
Build / Build Binary (linux-amd64) (pull_request) Successful in -1m9s
Build / Build and Test Deb and RPM Packages (push) Successful in 12s
Build / Build Binary (linux-arm64) (pull_request) Successful in -1m19s
Build / Build Binary (macos-amd64) (pull_request) Successful in -1m5s
Build / Build Binary (macos-arm64) (pull_request) Successful in -48s
Build / Build Binary (windows-amd64) (pull_request) Successful in -38s
Build / Publish Release (push) Successful in -2m35s
Build / Pipeline (push) Successful in 0s
Build / Build Arch Linux Packages (pull_request) Successful in -1m43s
Build / Smoke Test the Windows Binary (pull_request) Successful in 24s
Build / Build and Test Deb and RPM Packages (pull_request) Successful in -37s
Build / Build and Push Image (pull_request) Successful in -2m32s
Build / Publish Release (pull_request) Successful in -2m35s
Build / Pipeline (pull_request) Successful in 0s
185b7ae308
Refs #350

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
claude merged commit a2fb413ab7 into develop 2026-11-13 00:58:38 -05:00
claude deleted branch feature/350-quic-transfer-end-of-stream 2026-11-13 00:58:38 -05:00
Sign in to join this conversation.
No reviewers
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil!400
No description provided.