You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agre, this is a potential bug and could lead to duplicated jobs being queued. However, there's the potential that the FOR UPDATE will lock all the rows accessed by the resource function (the docs are not super clear on this case when using a procedure). Therefore, there is the option to do FOR UPDATE OF ? and only lock the job table row that is being polled. For Supercede (IIRC, it's been a while), I believe this would be a roughly appropriate semantics, since the rows in the resource table do not need to be locked when queuing a new job - they are only read from, and synchronisation would not do anything.
However, it's not clear to me that this would be the case in general, and I don't have the resources or a test case to dig into whether FOR UPDATE or FOR UPDATE OF ? is better or more performant.
If you compare
jobPollingSql
vsjobPollingWithResourceSql
you'll find that the latter not using "FOR UPDATE"odd-jobs/src/OddJobs/Job/Query.hs
Lines 22 to 34 in a159d7a
cc: @ivb-supercede
The text was updated successfully, but these errors were encountered: