Closed oerp-odoo closed 1 month ago
There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.
Module
queue_job
Describe the bug
I am using queue job that consists of a chain having inside single jobs and group of jobs.
So my chain looks like this:
Job1 -> Job2 -> JobsGroup -> Job4
When Job2 completes, it does some changes in database, where
JobsGroup
depends on. Every time I runJobsGroup
, it sees outdated data as if Job2 changes did not happen. Though after all jobs are complete, I can see that changes did happen.At first I thought that maybe they were run in parallel (as Job2 completed very fast). But when I added
sleep
time onJob2
I can clearly see that JobsGroup waits for Job2 to complete.As a side note, I use these jobs with odoo import functionality. So maybe it also has something do to with it (as odoo uses savepoints and so on)? (Job2 imports/updates record that
JobsGroup
depend on and thenJobsGroup
imports child records after waiting for parent record import/update. Basically Job2 is parent record and JobsGroup consists of child records with one2many relationship).Though if I change logic, to only run
JobsGroup -> Job4
, then it properly sees changes that happened before.To Reproduce
Affected versions: 15.0
Here is snippet of my logic, how I create delayables and how jobs are started.
Expected behavior I would expect other jobs that are run in chain, to see changes that happened before them.
Additional context Add any other context about the problem here. (e.g. OS, Python version, ...)