You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
await_any_or_fail deadlocks when only later futures complete #103
=== DEADLOCK REPORT START ===
Coroutines waiting: 2, active_events: 0
Coroutine 6 spawned at :0, suspended at repro.php:19 (main)
waiting for: Coroutine 10 ...
Coroutine 10 spawned at repro.php:15, suspended at repro.php:16
waiting for:
If the producer completes the first future ($s1->complete(1)) instead, the test passes — the awaiter wakes up and returns 1. So await_any_or_fail appears to register a listener only on the first trigger of the iterable, ignoring the rest.
Where it was found
fuzzy_tests/await/await_any.feature, Examples row which=F2, deterministic
under FIFO and every random scheduler tested. Found by the chaos harness
introduced in #102.
Existing tests/await/*.phpt for await_any* exclusively pass arrays of Coroutines as triggers — none of them combine await_any_or_fail with Async\Future instances. That is why the bug has slipped through.
Verified the symmetric case with coroutines works:
So the trigger-registration path for Future in await_any_or_fail
appears not to be wired up symmetrically with the Coroutine path. The
listener for the second (and presumably any later) Future trigger is
either not installed or never fires.
Suggests adding a phpt that uses Future triggers for every await_any* / await_first* variant.
Activity
#102: 3 new chaos topics, coverage report, real bug found (#103)
EdmondDantes commentedon May 9, 2026
Investigation: bug is Future-specific
Existing
tests/await/*.phptforawait_any*exclusively pass arrays ofCoroutines as triggers — none of them combine
await_any_or_failwithAsync\Futureinstances. That is why the bug has slipped through.Verified the symmetric case with coroutines works:
So the trigger-registration path for Future in
await_any_or_failappears not to be wired up symmetrically with the Coroutine path. The
listener for the second (and presumably any later) Future trigger is
either not installed or never fires.
Suggests adding a phpt that uses
Futuretriggers for everyawait_any*/await_first*variant.#103: fix await_any_or_fail deadlock when later Future is completed
#103: SUSPEND replays closed events instead of sleeping forever
#103: drop module-static cache of ChannelCloseReason enum cases
#125 fuzzy_tests: cross-thread ThreadChannel feature + restore await_…