zlacker

[parent] [thread] 4 comments
1. hipade+(OP)[view] [source] 2023-11-20 17:20:47
> should be triggered iff the transaction commits

Agreed. Which is why the design doesn't make any sense. Because in the scenario presented they're starting a job during a transaction.

replies(4): >>j45+wf >>terafl+zi >>Chris9+Gi >>eximiu+gl
2. j45+wf[view] [source] 2023-11-20 18:13:33
>>hipade+(OP)
Maybe it’s not designed for that or all use cases and that can make sense.

Personally, I need long running jobs.

3. terafl+zi[view] [source] 2023-11-20 18:24:10
>>hipade+(OP)
I don't understand what you mean. The job is "created" as part of the transaction, so it only becomes visible (and hence eligible to be executed) when the transaction commits.
4. Chris9+Gi[view] [source] 2023-11-20 18:24:35
>>hipade+(OP)
The job is queued as part of the transaction. It is executed by a worker outside the scope of the transaction.
5. eximiu+gl[view] [source] 2023-11-20 18:33:48
>>hipade+(OP)
That part is somewhat poorly explained. That is a motivating example of why having your job queue system be separate from your system of record can be bad.

e.g.,

1. Application starts transaction 2. Application updates DB state (business details) 3. Application enqueues job in Redis 4. Redis jobworkers pick up job 5. Redis jobworkers error out 6. Application commits transaction

This motivates placing the jobworker state in the same transaction whereas non-DB based job queues have issues like this.

[go to top]