Skip to content

Don't go to idle/scheduled from workpool for 5s cooldown period#177

Draft
ianmacartney wants to merge 6 commits intomainfrom
ian/status-idle-cooldown
Draft

Don't go to idle/scheduled from workpool for 5s cooldown period#177
ianmacartney wants to merge 6 commits intomainfrom
ian/status-idle-cooldown

Conversation

@ianmacartney
Copy link
Member

@ianmacartney ianmacartney commented Mar 6, 2026

Goal is to reduce the frequency of status changes to avoid OCCs on tasks trying to start the workpool.

  • Make a scenario that does infrequent bursts of enqueue to see if this helps with OCCs

Add cooldown mechanism to prevent premature idle transitions

Implement a 5-second cooldown period in updateRunStatus that checks if any cursor was active recently before transitioning to idle state. If any of the segment cursors (incoming, completion, or cancelation) were updated within the cooldown window, the system continues running by scheduling the next main loop iteration.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@coderabbitai
Copy link

coderabbitai bot commented Mar 6, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 221638cc-57cb-4688-88f4-6f50d3f4f1df

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ian/status-idle-cooldown

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.

❤️ Share

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 6, 2026

Open in StackBlitz

npm i https://pkg.pr.new/get-convex/workpool/@convex-dev/workpool@177

commit: d047588

@ianmacartney ianmacartney changed the title updateRunStatus looping when idle Don't go to idle/scheduled from workpool for 5s cooldown period Mar 6, 2026
@ianmacartney ianmacartney requested a review from reeceyang March 6, 2026 23:26
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.

2 participants