Repository navigation
Payload 4.0 stable timeline, and backport of the atomic job claim (#17441) to 3.x? #18614
Replies: 1 comment
|
For the interim v3 setup, I would keep one active runner per queue and prevent overlapping run calls. That is a mitigation for this claim race, not an exactly-once guarantee or an official release recommendation. A single process can still overlap two cron/manual/API-triggered runs, and a rolling deployment can temporarily have both old and new runner replicas alive. Your source-level diagnosis matches the MongoDB adapter in v3.90.2. In the limited, non-ID path, it finds candidate IDs, replaces the query with an PR #17441 is useful here because its MongoDB fix still uses find/update/find. The difference is ownership: a conditional claim writes a unique Until you have a released fix validated for your version, I would check:
A I can't give a 4.0 stable date or confirm a v3 backport commitment; those need a maintainer response. I reviewed the released source and the merged PR, but have not run your deployment or a MongoDB concurrency reproduction. |
Uh oh!
There was an error while loading. Please reload this page.
We run Payload 3.x jobs with more than one runner on the same queue and hit the non-atomic job claim:
updateJobsin@payloadcms/db-mongodbclaims a job in three steps (find → updateMany → find), so two runners can claim and run the same job. For now we limit ourselves to a single runner.#17441 (feat!: support multiple workers on the same queue) fixes this, but it is only in 4.0, which has canary builds only.
findOneAndUpdateforlimit: 1? It fixes a correctness bug (duplicate job runs), not a new feature.Thanks!
All reactions