The DoT write-deadline test no longer fails when a loaded runner cuts the stalled client before its first query #360

Closed
opened 2026-11-06 18:14:46 -05:00 by claude · 1 comment
Owner
  • Draft: none (found 2026-11-06 in PR #353 run 1298, Test .NET)
  • Priority: medium (a flaky CI test blocks merges)
  • Agent: protocol-coder
  • Depends on: none
  • Decisions: none

Why

DnsOverTlsSessionTests.AClientThatStopsReading_IsCutByTheWriteDeadline_WithoutHurtingOthers (src/dotnet/tests/Ninlil.Dns.Protocol.DnsOverTls.Tests/DnsOverTlsSessionTests.cs) failed in run 1298 with IOException: Unable to write data to the transport connection: Broken pipe. The rest of Test .NET passed, and the PR does not touch DoT.

  • The throw comes from WriteQueryAsync called directly by the test method. That is the stalled client's AXFR write, made right after ConnectWithRetryAsync, not one in ConnectUntilServedAsync.
  • The class runs with a 400 ms idle timeout that the listener also uses as the TLS handshake and idle deadline. On a loaded runner the server can close the stalled connection before its first query is written. The write then hits a broken pipe.
  • Commit 9add760f made the clients that must be served retry, for the same reason. The stalled client's first write is still a single attempt. This is a hypothesis from the trace; it has not been reproduced.

What changes

  • Confirm the cause, ideally red with a forced short idle timeout or a delay before the stalled client's write.
  • Make the stalled client's connect and first write retry as a unit on IOException or SocketException, within the existing bounds, so the test still proves the write deadline and that other clients are served. Do not lengthen the idle timeout for the whole class if it slows other tests.
  • Check the other tests in the file for the same single-shot first write.

Acceptance

  • The cause is shown, or the fix is argued from the code if it cannot be forced.
  • The test passes 20 times in a row in the CI container on asgard at nice -n 10.
- **Draft:** none (found 2026-11-06 in PR #353 run 1298, Test .NET) - **Priority:** medium (a flaky CI test blocks merges) - **Agent:** protocol-coder - **Depends on:** none - **Decisions:** none ### Why `DnsOverTlsSessionTests.AClientThatStopsReading_IsCutByTheWriteDeadline_WithoutHurtingOthers` (`src/dotnet/tests/Ninlil.Dns.Protocol.DnsOverTls.Tests/DnsOverTlsSessionTests.cs`) failed in run 1298 with `IOException: Unable to write data to the transport connection: Broken pipe`. The rest of Test .NET passed, and the PR does not touch DoT. - The throw comes from `WriteQueryAsync` called directly by the test method. That is the stalled client's AXFR write, made right after `ConnectWithRetryAsync`, not one in `ConnectUntilServedAsync`. - The class runs with a 400 ms idle timeout that the listener also uses as the TLS handshake and idle deadline. On a loaded runner the server can close the stalled connection before its first query is written. The write then hits a broken pipe. - Commit 9add760f made the clients that must be served retry, for the same reason. The stalled client's first write is still a single attempt. This is a hypothesis from the trace; it has not been reproduced. ### What changes - Confirm the cause, ideally red with a forced short idle timeout or a delay before the stalled client's write. - Make the stalled client's connect and first write retry as a unit on IOException or SocketException, within the existing bounds, so the test still proves the write deadline and that other clients are served. Do not lengthen the idle timeout for the whole class if it slows other tests. - Check the other tests in the file for the same single-shot first write. ### Acceptance - [ ] The cause is shown, or the fix is argued from the code if it cannot be forced. - [ ] The test passes 20 times in a row in the CI container on asgard at `nice -n 10`.
Author
Owner

Second failure, this time on develop (push run 1300 at 564336b1, the #353 merge). It shows the other side of the same race:

  • System.TimeoutException: The operation has timed out at DnsOverTlsSessionTests.cs:line 128, which is await transferEnded.Task.WaitAsync(SafetyTimeout), after 31 s.
  • So the stalled client's write succeeded (into the socket buffer), but no transfer ever started or ended. This fits the server cutting the stalled connection at the 400 ms idle deadline before it read the AXFR query.
  • A fix must therefore prove the transfer STARTED (for example a TransferStarted signal from BulkZoneTransferService) before it waits for the write deadline, and retry connect plus query until it has started. Only then does the test check the deadline.

Priority raised to high: develop is red on this test.

Second failure, this time on develop (push run 1300 at 564336b1, the #353 merge). It shows the other side of the same race: - `System.TimeoutException: The operation has timed out` at `DnsOverTlsSessionTests.cs:line 128`, which is `await transferEnded.Task.WaitAsync(SafetyTimeout)`, after 31 s. - So the stalled client's write succeeded (into the socket buffer), but no transfer ever started or ended. This fits the server cutting the stalled connection at the 400 ms idle deadline before it read the AXFR query. - A fix must therefore prove the transfer STARTED (for example a `TransferStarted` signal from `BulkZoneTransferService`) before it waits for the write deadline, and retry connect plus query until it has started. Only then does the test check the deadline. Priority raised to high: develop is red on this test.
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.

Dependencies

No dependencies set

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