3 ms·
so the process that fails releases the lock marking the job undone which causes another process to lock it?
by nurettin 7y ago
so the process that fails releases the lock marking the job undone which causes another process to lock it?
- xyzzy_plugh 7y agoIt means another process could grab it, yes. In the parent post's model, the "scheduler" operates in a "at least once" model", as unless the transaction is committed, a premature failure would result in the message will be picked up again by a scheduler, which could result in some duplicate work. The parent post's model also tracks "attempts", but this only captures known or acknowledged failures -- unacknowledged failures (i.e. crashes) will not be recorded, so a task which explodes the process would be re-run ad infinitum. An alternative method could be to record an attempt in a separate transaction, so that the next scheduler execution can detect that the job/message was serviced before, even if the message itself appears fresh.