Repository navigation
[Fix] scheduler: throttle polling loop when scheduler is paused - #46307
Open
PratikCreates wants to merge 1 commit into
Open
PratikCreates wants to merge 1 commit into
PratikCreates wants to merge 1 commit into
Conversation
PratikCreates
requested review from
Ying1123,
hnyls2002,
merrymercy and
xiezhq-hermann
as code owners
October 24, 2026 15:13
PratikCreates
force-pushed
the
fix/pause-scheduler-busy-loop
branch
2 times, most recently
from
October 25, 2026 11:08
34d8e2b to
d4d39a6
Compare
This was referenced Oct 26, 2026
PratikCreates
force-pushed
the
fix/pause-scheduler-busy-loop
branch
3 times, most recently
from
October 28, 2026 19:01
8912b14 to
3876cd4
Compare
When the scheduler is paused, the event loop continuously polled non-blocking sockets and recorded metrics in a tight loop without waiting. Call maybe_sleep_on_idle if an idle sleeper is available, or fall back to sleeping 5ms to avoid spinning CPU cores while paused. Added unit test. Signed-off-by: PratikCreates <139613382+PratikCreates@users.noreply.github.com>
PratikCreates
force-pushed
the
fix/pause-scheduler-busy-loop
branch
from
November 1, 2026 21:04
3876cd4 to
6b9b4c9
Compare
This branch has not been deployed
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.
Motivation
When the scheduler is paused (self._engine_paused = True), the event loops repeatedly poll non-blocking sockets and record metrics in a tight loop without waiting, which can spin CPU cores during pause states.
Modifications
Checklist
CI States
Latest PR Test (Base): ❌ Run #41350119225
Latest PR Test (Extra): ❌ Run #41350119211
Latest PR Test (AMD ROCm 10): ❌ Run #41350119124
Tip
Base CI only covers the core cases, and its workload may not exercise your change. Use
/rerun-testto run the tests your change touches, or copy this prompt for an agent: