-
Notifications
You must be signed in to change notification settings - Fork 390
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
perf: keep jobs in waiting list when queue is paused #2769
base: v6
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some initial comments, more will come.
@@ -16,13 +16,13 @@ const originalTree = await flow.add({ | |||
name, | |||
data: { idx: 0, foo: 'bar' }, | |||
queueName: 'childrenQueueName', | |||
opts: { failParentOnFailure: true }, | |||
opts: { onChildFailure: 'fail' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice change.
python/bullmq/scripts.py
Outdated
@@ -451,6 +462,15 @@ async def retryJobs(self, state: str, count: int, timestamp: int): | |||
result = await self.commands["moveJobsToWait"](keys=keys, args=args) | |||
return result | |||
|
|||
async def repairDeprecatedPausedKey(self, maxCount: int): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need proper documentation on how and when a call to this method is needed.
src/classes/job.ts
Outdated
@@ -39,10 +39,8 @@ const logger = debuglog('bull'); | |||
|
|||
const optsDecodeMap = { | |||
de: 'debounce', | |||
fpof: 'failParentOnFailure', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't we need to keep this old mappings to not cause a data breaking change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should introduce a "migration" mechanism here. Something like migration steps for going between versions that are run if required in Lua scripts for atomicity. But we would need to keep a version number in the meta key, adding complexity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can keep this mappings that will be only used to format options of jobs with these old values, but no migration is needed as we are evaluation old and new option in lua scripts, new jobs will use new option
src/classes/job.ts
Outdated
@@ -1210,27 +1208,6 @@ export class Job< | |||
throw new Error(`Delay and repeat options could not be used together`); | |||
} | |||
|
|||
if (this.opts.removeDependencyOnFailure && this.opts.failParentOnFailure) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice to be able to remove this
src/classes/queue.ts
Outdated
/** | ||
* Remove legacy markers before v5 | ||
*/ | ||
removeLegacyMarkers(): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation about this is also needed. Most importantly practical information in how to apply something like this in the context of a production deployment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a me migrations section for it
src/classes/queue.ts
Outdated
* | ||
* @param maxCount - Max quantity of jobs to be moved to wait per iteration. | ||
*/ | ||
async repairDeprecatedPausedKey(maxCount: number = 1000): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should "repair" be the proper name or actually something like "migrate" would be more accurate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can change it, let me do it
No description provided.