Repository navigation
fix(perf): stop open-loop dispatch at duration deadline - #1501
Merged
Yunnglin merged 2 commits intoJul 21, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds duration deadline checks to the open-loop performance strategy to stop dispatching requests once the deadline is reached, and includes a unit test to verify this behavior. The review feedback points out that the newly added checks introduce redundancy with existing pre-sleep checks, and suggests removing the redundant pre-sleep checks to simplify the code.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
This branch had an error being 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.
Summary
Fix open-loop scheduling so no new request is dispatched after the
--durationdeadline.The fix covers both:
workload_tracearrival-offset schedulingProblem
The scheduler caps its sleep to the remaining time before the deadline. However, after the sleep returns, it previously created the request task without checking the deadline again.
As a result, a request scheduled beyond the duration limit could still be dispatched exactly when the deadline was reached.
This conflicts with the documented soft-exit behavior: new requests should stop at the deadline, while requests already in flight are allowed to finish.
Changes
Scope
This is intentionally a narrow scheduler fix.
It does not change:
Testing
pytest tests/perf/test_open_loop_strategy.py -qpytest tests/cli/test_all.py::TestRun::test_ci_lite -v -s -p no:warningspre-commit run --all-filesAll checks passed.
Related Issues
Fixes #1500.
Related to #1494.