Skip to content

Drain the listener on the same margin the client uses - #812

Merged
SimonCropp merged 1 commit into
mainfrom
fix-listener-drain-margin
Aug 22, 2026
Merged

Drain the listener on the same margin the client uses#812
SimonCropp merged 1 commit into
mainfrom
fix-listener-drain-margin

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

AnOwnerAnswersAClient failed on Windows with a TimeoutException out of Wait: the
listener had not unwound within five seconds of being cancelled. A re-run with
no code change went green.

The comment on underLoad already describes exactly why: CI starts six test
assemblies at once on a two core runner, and an answer arriving on a scheduled
task has twice missed a deadline set for an idle machine. Unwinding the accept
needs its continuation scheduled on that same pool, so Wait was making the bet
the client timeout above it had already stopped making. It now uses the same
constant, so there is one number rather than two that disagree.

Still throws when it runs out. A listener that never unwinds is a real bug, and
this is the only place that would notice - so the margin is widened rather than
the failure swallowed.

AnOwnerAnswersAClient failed on Windows with a TimeoutException out of Wait: the
listener had not unwound within five seconds of being cancelled. A re-run with
no code change went green.

The comment on underLoad already describes exactly why: CI starts six test
assemblies at once on a two core runner, and an answer arriving on a scheduled
task has twice missed a deadline set for an idle machine. Unwinding the accept
needs its continuation scheduled on that same pool, so Wait was making the bet
the client timeout above it had already stopped making. It now uses the same
constant, so there is one number rather than two that disagree.

Still throws when it runs out. A listener that never unwinds is a real bug, and
this is the only place that would notice - so the margin is widened rather than
the failure swallowed.
@SimonCropp
SimonCropp merged commit 4e4102c into main Aug 22, 2026
9 checks passed
@SimonCropp
SimonCropp deleted the fix-listener-drain-margin branch August 22, 2026 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant