zlacker

[parent] [thread] 2 comments
1. shoo+(OP)[view] [source] 2021-12-18 02:46:01
if you care to elaborate, i'm curious -- what alternative(s) would you recommend instead of one transaction per message, and why?
replies(2): >>charci+Ru >>foo_ba+8Vc
2. charci+Ru[view] [source] 2021-12-18 08:57:43
>>shoo+(OP)
The article's approach is to have a column that stores if he job has been claimed and then handles dead jobs by just having a timeout.
3. foo_ba+8Vc[view] [source] 2021-12-22 15:41:43
>>shoo+(OP)
What if you want to store an error message+status with the job if it fails? It means you have to commit something no? What if you want to mark the message as being worked on and what process locked it and when they did for some kind of job queue monitoring stats?

The times I have done this, I end up with a workflow where the "select for update ... skipped lock" is used only to initially mark the job as "taken" so that other processes do not start working on it. That update is committed in one transaction and then the "work" is done in second transaction.

[go to top]