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(move-to-finished): consider addition of prioritized jobs when processing last active job #2176

Merged
merged 2 commits into from
Sep 11, 2023

Conversation

roggervalf
Copy link
Collaborator

No description provided.

@@ -669,14 +669,44 @@ describe('workers', function () {
const worker = new Worker(queueName, processor, { connection });
await worker.waitUntilReady();

// wait for all jobs to enter the queue and then start processing
await Promise.all([normalPriority, mediumPriority, highPriority]);

await processing;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

by awaiting this line is sufficient

@roggervalf roggervalf requested a review from manast September 10, 2023 18:51
Copy link
Contributor

@manast manast left a comment

Choose a reason for hiding this comment

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

small typo

if jobId then
if string.sub(jobId, 1, 2) == "0:" then
rcall("LREM", KEYS[2], 1, jobId)

-- If jobId is special ID 0:delay (delay grater than 0), then there is no job to process
Copy link
Contributor

Choose a reason for hiding this comment

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

grater -> greater

@@ -669,14 +669,44 @@ describe('workers', function () {
const worker = new Worker(queueName, processor, { connection });
Copy link
Contributor

Choose a reason for hiding this comment

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

@roggervalf I think that
await Promise.all([...normalPriority,...mediumPriority,...highPriority]);
should be added before creating a new worker, as you need to make sure that all jobs are entered before worker starts processing jobs.
When I run the test with this fixes the test failed as some jobs where added after the worker start processing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I see, probably in case of dragonfly its needed, ok let me add it back

@roggervalf roggervalf merged commit 4b01f35 into master Sep 11, 2023
@roggervalf roggervalf deleted the fix-prioritized-job-process-after-last-active branch September 11, 2023 13:59
github-actions bot pushed a commit that referenced this pull request Sep 12, 2023
# [4.10.0](v4.9.0...v4.10.0) (2023-09-12)

### Bug Fixes

* **move-to-finished:** consider addition of prioritized jobs when processing last active job ([#2176](#2176)) (python) ([4b01f35](4b01f35))
* **remove:** change error message when job is locked (python) ([#2175](#2175)) ([2f5628f](2f5628f))

### Features

* **flow-producer:** add addBulk method (python) ([#2174](#2174)) ([c67dfb4](c67dfb4))
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.

3 participants