Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
"bippy": "0.5.43",
"concurrently": "10.0.4",
"cross-env": "10.1.0",
"electron": "40.10.2",
"electron": "^40.10.6",
"electron-builder": "26.15.3",
"esbuild": "0.28.1",
"jsdom": "29.1.1",
Expand All @@ -184,7 +184,7 @@
"tsx": "4.23.1",
"typescript": "6.0.3",
"vite": "8.2.0",
"vitest": "4.1.10",
"vitest": "^4.1.11",
"wait-on": "9.0.10"
},
"build": {
Expand Down
13 changes: 10 additions & 3 deletions cron/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2591,12 +2591,19 @@ def apply(jobs, _i, job):


def heartbeat_fire_claim(job_id: str, *, expected_owner: str) -> bool:
"""Refresh an active ``fire_claim`` without extending another owner's lease: an execution may
outlive the TTL, and the owner check stops a stale runner from refreshing a recovered claim."""
"""Refresh an active ``fire_claim`` without extending another owner's lease.

This deliberately bypasses ``_fire_job_lock``. The fence is held by the
active worker across save/delivery, while this heartbeat runs on its helper
thread; taking the same per-job RLock would block the heartbeat behind its
own worker and falsely declare ownership lost after the lock timeout. The
jobs lock plus ``expected_owner`` is the actual CAS fence: completion clears
or replaces the claim, and a late heartbeat then returns False.
"""
def apply(jobs, _i, job):
return _refresh_claim(jobs, job.get("fire_claim"), expected_owner)

return _under_fire_fence(job_id, lambda: _with_job(job_id, apply, False))
return _with_job(job_id, apply, False)


# Completed one-shots are retained in jobs.json (final status stays inspectable) and pruned by
Expand Down
Loading