[API] Locking job doesn't lock record
API server Job.lock uses a "transaction" but this doesn't guarantee atomic read-update-write operations. Need to use "with_lock" instead.
with_lock "Wraps the passed block in a transaction, locking the object before yielding. You can pass the SQL locking clause as argument (see lock!)."
lock! "Obtain a row lock on this record. Reloads the record to obtain the requested lock. Pass an SQL locking clause to append the end of the SELECT statement or pass true for “FOR UPDATE” (the default, an exclusive row lock). Returns the locked record.
Implemented in branch 8840-lock-job-record.
#5 Updated by Brett Smith about 5 years ago
505b768 looks great, please merge. Thanks.
https://ci.curoverse.com/job/developer-test-job/98/console (failed in a FUSE test, but that looks like a teardown race condition or similar to me)