Skip to content

fix(worker): resume processing after pause with doNotWaitActive#3974

Merged
roggervalf merged 4 commits intomasterfrom
fix-resume-worker
Apr 12, 2026
Merged

fix(worker): resume processing after pause with doNotWaitActive#3974
roggervalf merged 4 commits intomasterfrom
fix-resume-worker

Conversation

@roggervalf
Copy link
Copy Markdown
Collaborator

Why

  1. Why is this change necessary? Workers are stuck after applying pause(true) if we try to resume later

How

Enter the implementation details here.

Additional Notes (Optional)

fixes #3971

Copilot AI review requested due to automatic review settings April 9, 2026 06:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a Worker state-machine edge case where calling pause(true) (doNotWaitActive) could leave the worker unable to resume job processing, addressing issue #3971.

Changes:

  • Adjust Worker.resume() to work even when this.running === true but the worker is paused.
  • Restart the stalled checker when resuming from a doNotWaitActive pause.
  • Add a regression test covering pause(true) + resume() behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/classes/worker.ts Updates resume() logic to unpause even when the main loop is still running and restarts stalled checks.
tests/worker.test.ts Adds a test to ensure processing continues after pause(true) followed by resume().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/classes/worker.ts Outdated
Comment thread src/classes/worker.ts
Comment thread tests/worker.test.ts Outdated
Comment thread tests/worker.test.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/classes/worker.ts Outdated
Comment thread tests/worker.test.ts
@roggervalf roggervalf merged commit 8b8d464 into master Apr 12, 2026
46 of 49 checks passed
@roggervalf roggervalf deleted the fix-resume-worker branch April 12, 2026 20:11
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 5.73.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.20.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: resume() is a no-op after pause(true), worker stays stuck

4 participants