Repository navigation
libs/hash: async_heavy_test's responsive check ordered through a latch, never through the scheduler - #42
Merged
Conversation
…sive check orders the timer before the completion through a latch CI run 44690351573 failed async_heavy_no_exceptions on MSVC 14.3 (timer_fired_first): check_responsive raced a 10 ms timer on the caller's io_context against an Argon2id of 64 MiB on the pool, and when the caller's thread was descheduled for longer than the derivation, Windows's scheduler ran the queued completion before the expired timer. The work now runs on a test backend that holds its completion until the timer's handler lets it, so the order no longer depends on the scheduler.
pinhopro
force-pushed
the
fix/async-heavy-flake
branch
from
November 20, 2026 10:29
2ae4b25 to
0569f64
Compare
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.
Bumps
libs/hashto webcpporg/hash#8 (fix/async-heavy-flake).CI run 44690351573 failed
msvc-14.3: hash/async_heavy_no_exceptions: runwithasync_heavy_test.cpp(898): test 'timer_fired_first' failed in function check_responsive. The check raced a 10 ms timer on the caller'sio_contextagainst an Argon2id of 64 MiB on the pool; when the caller's thread was descheduled for longer than the derivation, Windows's scheduler (IOCP) ran the already queued completion before the expired timer. A 500 ms delay between the call andrun()reproduces it on the local msvc-lane every time.The work now runs on a test backend,
latched, that derives with libsodium and then holds its completion until the timer's handler lets it, so the timer always fires while the work is in flight and the order no longer depends on the scheduler; the result is still compared with the synchronous function's. With the same injected delay,async_heavyandasync_heavy_no_exceptionspass on MSVC 14.3 under Wine and natively. macOS full lint is clean.🤖 Generated with Claude Code