-
-
Notifications
You must be signed in to change notification settings - Fork 537
[16.0] queue_job: backports from 18.0 #874
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
base: 16.0
Are you sure you want to change the base?
Conversation
|
Hi @guewen, |
This allows creating test job with a long duration for stress testing.
When a SerializationFailure occurs when updating the state of dependent jobs, the cursor is not usable anymore so the retry failed with `current transaction is aborted`. A savepoint fixes that.
In this commit we cleanly separate the job acquisition (i.e. verifying the job is in the exepected state, marking it started and locking it) from job execution. We also avoid trying to start the job if it is already locked by using SKIP LOCKED and exiting early. Indeed in such situations the job is likely already being handled by another worker so there is no point trying to start it, so we exit early and let it be handled either by the other worker or the dead job requeuer.
Extract the logic to run one job out of the /queue_job/runjob route. Towards making this logic reusable in other job executors.
Towards making this logic reusable.
Since we are not going to delete records nor modify foreign keys, we can take a weaker lock.
b4dada5 to
227a5e7
Compare
…rts patches Otherwise monkey-patches could be added twice when instantiating new test classes.
|
@thomaspaulb I did not review each line. Can you confirm the cherry picks did apply cleanly, or did you have to fiddle and there are things that need additional eyes? |
|
I think in the end they all cherry-picked cleanly, when they did not, I just went looking for some prerequisite ones that i missed before. But there may have been one case of fiddling. If you want to know for sure I could go and repeat the cherrypicking to doublecheck. Also, today this went into production so some feedback may come of that. If both these "checks" come out OK i guess we can merge. |
Backports of:
enqueue_waiting#867These are basically blind cherry-picks, so let's first see how the unit tests run and how this behaves in production