Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(worker): wait fetched jobs to be processed when closing #3059

Merged

Conversation

manast
Copy link
Contributor

@manast manast commented Feb 6, 2025

Why

This change is necessary to avoid possible stalled jobs when closing a worker, since the close operation just stops processing the jobs that may be already in active status but have not yet started to be processed.

How

Making sure that we wait for the jobs to complete before resolving the close promise.

Additional Notes (Optional)

Any extra info here.

Copy link
Collaborator

@roggervalf roggervalf left a comment

Choose a reason for hiding this comment

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

Lgtm, just a minor styled comment

@@ -29,6 +29,7 @@ describe('events', function () {

beforeEach(async function () {
queueName = `test-${v4()}`;
console.log('queueName', queueName);
Copy link
Collaborator

Choose a reason for hiding this comment

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

this line can be removed

@roggervalf roggervalf changed the title fix(worker): wait fetched jobsto-be processed when closing fix(worker): wait fetched jobs to be processed when closing Feb 7, 2025
@roggervalf roggervalf merged commit d4de2f5 into master Feb 7, 2025
11 checks passed
@roggervalf roggervalf deleted the fix/wait-fetched-jobs-to-be-processed-when-closing branch February 7, 2025 02:04
github-actions bot pushed a commit that referenced this pull request Feb 7, 2025
## [5.40.1](v5.40.0...v5.40.1) (2025-02-07)

### Bug Fixes

* **worker:** wait fetched jobs to be processed when closing ([#3059](#3059)) ([d4de2f5](d4de2f5))
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