Commit Graph

2 Commits

Author SHA1 Message Date
Marek Miklewicz bbc1afb5e1 Fix worker.sh lock permanently stalling after a crash
The mkdir-based worker lock had no staleness detection at all, unlike
BackupQueueService::withQueueLock()'s 120s override for its own queue
lock. If the root cron-driven worker was ever killed ungracefully (OOM,
kill -9, reboot mid-job), the lock directory was left behind forever -
every subsequent cron tick would silently exit without processing any
job, so backups/restores would queue forever with no visible error.

Track the owning PID inside the lock directory and reclaim the lock
when that PID is no longer running, or when the lock has no PID file
and is older than WORKER_LOCK_STALE_SECONDS (default 300s). Log to
stderr on both the "held by a live worker" and "reclaiming stale lock"
paths instead of exiting silently either way. cleanup() now uses rm -rf
since the lock directory holds a pid file, not just an empty marker.
2026-07-04 21:56:52 +02:00
Marek Miklewicz d71fcf9ace Import alt-mysql plugin 2026-07-04 15:48:19 +02:00