Skip to content

[12.0][BKP] queue_job: identity_key enhancements (Backport from 14.0) - #617

Merged
OCA-git-bot merged 2 commits into
OCA:12.0from
QuocDuong1306:12.0-bkp-imp-queue_job
Jan 30, 2024
Merged

[12.0][BKP] queue_job: identity_key enhancements (Backport from 14.0)#617
OCA-git-bot merged 2 commits into
OCA:12.0from
QuocDuong1306:12.0-bkp-imp-queue_job

Conversation

@QuocDuong1306

Copy link
Copy Markdown
Contributor

Backport from: #581

Richard deMeester and others added 2 commits January 18, 2024 16:24
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.
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @guewen,
some modules you are maintaining are being modified, check this out!

@simahawk

Copy link
Copy Markdown
Contributor

/ocabot merge minor

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 12.0-ocabot-merge-pr-617-by-simahawk-bump-minor, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit d09c247 into OCA:12.0 Jan 30, 2024
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at ea68c4e. Thanks a lot for contributing to OCA. ❤️

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants