Repository navigation
Make the DNS timeout self-test pass on a loaded build host - #2236
Merged
Merged
Conversation
The Debian reproducible-builds run of 3.51.0-1 failed on forky amd64 at htsdns_selftest.c:704: a resolve with its cancel flag already raised took more than 1.5 seconds. The host runs make -j42 with other builds, and a thread can stall that long there. The hosts whose resolve the test abandons (slow.test, slow4.test) now block on a gate the test opens at the end, instead of sleeping 3s. A resolve that returns with no answer then proves the timeout or cancel, with no upper time bound. The state.lock probe becomes the cancel flag of an unbounded resolve, so only a probe that got the lock mid-resolve lets it return empty. The gate gives up after 20s, so a regression fails the test instead of hanging it. Controls: holding state.lock across the resolve, ignoring the cancel, ignoring the deadline and silencing the worker tail each fail the test. Freezing the process 2s with SIGSTOP at 0.3s fails the old test and passes the new one at nine offsets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
Review found that a late lock probe could write into a returned stack frame and race the state.stop writes, and that the cut case swapped the thread runner and backend while its worker could still be starting. The probe is now static and joined with a bound, and both waits return early on failure. Also fix the slow_ms comment, which predated MOCK_GATED, and name the seven resolves the final wait counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The DNS timeout self-test failed the Debian reproducible-builds run of 3.51.0-1 on forky amd64. A resolve that should return at once took more than 1.5 seconds on a loaded build host. The slow hosts now answer only when the test opens a gate at the end. So an empty result can only come from the timeout or the cancel.
A reviewer should know what this gives up. The test no longer catches a cancel or a lock wait that is slow but ends within 20 seconds. A bound tight enough to catch it is the one that failed here. A broken resolve still fails the test rather than hangs it, because the gate gives up after 20 seconds.