Skip to content

fix(server): wake idle workers on admitted work - #807

Merged
svonava merged 1 commit into
mainfrom
codex/issue373-event-only-wakeup
Oct 18, 2026
Merged

svonava merged 1 commit into
mainfrom
codex/issue373-event-only-wakeup

Conversation

@svonava

@svonava svonava commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Remove the idle worker's recurring 1 ms poll by waking it on successful request admission or shutdown. Keep the configured idle coalescing window (3 ms by default), normal coalescing, first-request timeout, and batch limits. Caller-formed batches continue to bypass this loop.

Refs #373 as partial progress. This preserves the existing accumulation policy and does not establish sub-millisecond idle dispatch, strict whole-burst fusion, or throughput equivalence. PR #658 remains separate with its existing human review hold and unmet qualification criteria. No GPU or performance claim is made here.

Validation: 377 CPU tests passed, including 15 new controls for wakeup races, cancellation/shutdown, and the original lone/burst coalescing behavior. Ruff lint, formatting, and type checks pass.

Summary by CodeRabbit

  • Performance
    • Reduced unnecessary background activity while the worker is idle by having it wait for new work instead of repeatedly checking for it.
  • Reliability
    • Improved worker wake-up behavior when work arrives or the worker stops.

@svonava
svonava requested a review from a team as a code owner October 18, 2026 20:41
@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: fa4b68f4-0b2a-413e-a42a-86a522da8b2e
📥 Commits

Reviewing files that changed from the base of the PR and between 118ba91 and 6dfdaaf.

📒 Files selected for processing: 2
  • packages/sie_server/src/sie_server/core/worker/model_worker.py
  • packages/sie_server/tests/core/test_worker_idle_wakeup.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

📝 Walkthrough

ModelWorker now uses an event to wake its FCFS batch selector when work is submitted or the worker stops. The selector waits on the event instead of polling, then rechecks batcher queues. New tests cover admission, idle waiting, shutdown, and batch selection.

Changes: Worker idle wake-up

Layer / File(s) Summary
Signal work and validate idle selection
packages/sie_server/src/sie_server/core/worker/model_worker.py, packages/sie_server/tests/core/test_worker_idle_wakeup.py
ModelWorker sets an event after work submission and shutdown. When no batcher has pending items, the selector waits for the event, clears it, and rechecks queue state. Tests cover admission timing, idle behavior, cancellation, shutdown, and batch selection.

Suggested reviewers: krisztian-gajdar

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 6dfda

No actionable risk introduced by this change remains; it is ready to merge after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 35.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: waking idle workers when work is admitted.
  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@svonava

svonava commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact head 6dfdaaf1f128ed4e68cb31ef71d4e836658bd7d5. This replaces only idle polling with an admission event and preserves the configured coalescing policy; #373 remains partially addressed and PR #658 stays separate.

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@svonava
svonava merged commit 32c82e5 into main Oct 18, 2026
21 checks passed
@svonava
svonava deleted the codex/issue373-event-only-wakeup branch October 18, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant