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
- ignore() can be called on keys not yet in jobs table
- Reserve is done via update1() per key, client provides pid/host/connection_id
- Removed specific SQL query from spec
-`refresh()` — Adds new jobs as `pending` (from `key_source - target - jobs`)
156
+
-`ignore()` — Marks a key as `ignore` (can be called on keys not yet in jobs table)
155
157
-`reserve()` — Marks a pending job as `reserved` before calling `make()`
156
158
-`complete()` — Marks reserved job as `success`, or deletes it (based on `jobs.keep_completed` setting)
157
159
-`error()` — Marks reserved job as `error` with message and stack trace
@@ -452,21 +454,7 @@ The jobs table is created with the appropriate primary key structure matching th
452
454
453
455
### Conflict Resolution
454
456
455
-
Job reservation does **not** use transaction-level locking for simplicity and performance. Instead, conflicts are resolved at the `make()` transaction level:
456
-
457
-
```python
458
-
# Simple reservation (no locking)
459
-
UPDATE`_my_table__jobs`
460
-
SET status ='reserved',
461
-
reserved_time = NOW(),
462
-
user = CURRENT_USER(),
463
-
host =@@hostname,
464
-
pid = CONNECTION_ID()
465
-
WHERE status ='pending'
466
-
AND scheduled_time <= NOW()
467
-
ORDERBY priority DESC, scheduled_time ASC
468
-
LIMIT1;
469
-
```
457
+
Job reservation is performed via `update1()` for each key individually before calling `make()`. The client provides its own `pid`, `host`, and `connection_id` information. No transaction-level locking is used.
470
458
471
459
**Conflict scenario** (rare):
472
460
1. Two workers reserve the same job nearly simultaneously
0 commit comments