[14.0][IMP] queue_job: identity_key enhancements - #581
Merged
Conversation
Contributor
|
Hi @guewen, |
Contributor
Author
|
I've created #582 to follow up w/ the option to make states configurable per job. |
Member
|
Thanks! (To @richard-willdooit too) |
guewen
approved these changes
Nov 21, 2023
Contributor
Author
|
Build fixed on #583 |
1. In production, a job which is waiting dependencies or which has started, but not completed, should not be repeated if the identity_key matches. 2. In tests, the mock queue handler is now enhanced to allow better mimicking of the identity_key blocks from production. 3. In tests, the mock queue handler now clears the enqueued jobs after performing them, to better reproduce what a production environment would do.
Good explanation from Guewen: Depending on the use case, we should or should not include. As part of my current work, I use Sidekiq daily. They have a similar feature, but you can set a per-job parameter unique_until with options: start (that would mean up to ENQUEUED here) or success (that would be up to STARTED here). Think about this use case: a job refreshes a cache. Data have changed, we create a pending job. Data change again, no new job because the job is still pending. Job starts. Data change while the job is running. In this very case, we'd like to enqueue a new job otherwise the cache will be outdated. I reckon that both cases are valid, but I fear adding this state in the domain may, silently and in subtle ways, existing behaviors.
simahawk
force-pushed
the
14-identity-key-fix
branch
from
November 21, 2023 17:13
bfb631c to
53bc60e
Compare
Contributor
Author
|
/ocabot merge minor |
Contributor
|
This PR looks fantastic, let's merge it! |
Contributor
|
Congratulations, your PR was merged at 8240043. Thanks a lot for contributing to OCA. ❤️ |
This was referenced Nov 22, 2023
This was referenced Jan 18, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces #544
@richard-willdooit sorry, I really need to move this fwd on both 14 and 16.
I kept your commit here and I just dropped the odoo version from the msg.
I also added a specific commit to drop the STARTED state to make prominent the motivation provided by @guewen on https://github.com/OCA/queue/pull/546/files#r1232041609 (whole comment in the commit description).
I can fwd port to v16 later.