Repository navigation
Fixed bug that Hyperf\Coordinator\Timer::tick() caps the callback by the default 10s timeout of Hyperf\Coroutine\Waiter - #7764
Merged
limingxinleo merged 5 commits intoJun 17, 2026
Conversation
…y the default 10s timeout of `Hyperf\Coroutine\wait()`.
limingxinleo
approved these changes
Jun 17, 2026
Hyperf\Coordinator\Timer::tick() caps the callback by the default 10s timeout of Hyperf\Coroutine\wait()Hyperf\Coordinator\Timer::tick() caps the callback by the default 10s timeout of Hyperf\Coroutine\Waiter
limingxinleo
approved these changes
Jun 17, 2026
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.
Summary
-1as the timeout towait()insideTimer::tick(), so the callback is no longer capped by the implicit 10s timeout.Background
v3.1.70 (#7761) wrapped the
tick()callback inHyperf\Coroutine\wait()to run it inside a properly managed coroutine context, but did not pass a timeout.Waiter::wait()falls back to its defaultpopTimeoutof 10 seconds when no timeout is given:As a result, any
tick()callback that runs longer than 10s gets cut off:wait()throws aWaitTimeoutException,tick()catches it and logs it as an error,Timer::STOP— is lost, so the timer may keep ticking.Changes
src/coordinator/src/Timer.php: pass-1towait(...).Channel::pop(-1)waits indefinitely, so the callback always runs to completion and its return value is honored.-1is the same "no timeout" sentinel already used byWaitGroup::wait(-1)andWaitConcurrent::wait(-1)in this codebase.CHANGELOG-3.1.md: add aFixedentry underv3.1.71 - TBD.Test Plan
src/coordinator/tests/TimerTest.phpcases (testTick,testTickWhenReturnStop) keep passing — they use sub-millisecond callbacks, so the 10s timeout never engaged before or after.tick()callback that blocks for >10s now completes without aWaitTimeoutExceptionbeing logged, and returningTimer::STOPstill stops the timer.Risks