fix(gpu-arbiter): clamp drain_tick_seconds floor + remove double _signal_capacity wake#1987
fix(gpu-arbiter): clamp drain_tick_seconds floor + remove double _signal_capacity wake#1987hognek wants to merge 2 commits into
Conversation
…ck (jaylfc#1864 A3) Replace the hardcoded asyncio.sleep(2) in _process_queue with an asyncio.Event-based wake path. The drain loop now blocks on asyncio.wait_for(self._wake.wait(), timeout=drain_tick_seconds) so a reservation release or task completion immediately wakes the drain loop. The 2 s constant becomes the configurable fallback timeout (drain_tick_seconds, default 2.0). - __init__: new drain_tick_seconds param, self._wake Event - _signal_capacity(): new method — calls self._wake.set() - _process_queue: event-driven wait + clear, fallback timeout - _release_reservation: calls _signal_capacity on actual release - _run_gpu_task finally: calls _signal_capacity on completion - tests/test_gpu_arbiter_wakeup.py: 2 new tests * test_release_triggers_immediate_drain (60 s tick, < 0.5 s admit) * test_poll_tick_still_drains_without_signal (0.1 s tick)
…nal_capacity wake Kilo review on jaylfc#1986: 1. Clamp drain_tick_seconds to >= 0.01 in __init__ to prevent asyncio.wait_for(timeout=0) ValueError crash in _process_queue. 2. Remove redundant _signal_capacity() in _run_gpu_task finally — _release_reservation already calls it at line 250, making the line-448 call a double-wake on every task completion. 32/32 GPU arbiter tests pass.
|
Warning Review limit reached
Next review available in: 43 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by hy3:free · Input: 37.6K · Output: 1.2K · Cached: 106.9K |
Task: t_eb4779c9
Addresses Kilo review findings on #1986:
1. Clamp drain_tick_seconds to
>= 0.01(line 137)asyncio.wait_for(self._wake.wait(), timeout=0)raisesValueErrorandcrashes the
_process_queuedrain loop on startup whendrain_tick_secondsis zero or negative. Now clamped withmax(drain_tick_seconds, 0.01)in__init__.2. Remove redundant
_signal_capacity()call (line 448)_run_gpu_task'sfinallycalled_signal_capacity()at line 448, but_release_reservation(called immediately above at line 444) already fires_signal_capacity()at line 250. Double-wake on every task completion.While
Event.set()is idempotent, the duplicate was redundant — removed.Tests
32/32 GPU arbiter tests pass (test_gpu_arbiter_894.py, test_gpu_arbiter_toctou.py,
test_gpu_arbiter_wakeup.py, test_gpu_queue_flag.py).