Commit Graph
4 Commits
Author SHA1 Message Date
dualfroz e6a220f2b1 fix #4986: jobs: do not get stuck if the task log is missing
When the scheduler checks whether the last run of a job has finished,
it dies if the task log of that run does not exist. The job is then
skipped with 'could not update job state, skipping - no such task' on
every iteration, so it never runs again until its state file is
cleaned up manually.

The task log can be gone, for example after a crash. If the task is
not running anymore, treat it as stopped with an error status instead,
so that the job gets scheduled again, like Proxmox Backup Server does
since commit 48fbce07 ("fix #4895: scheduled jobs: ignore task-log not
found error").

The check now comes after the one whether the task is still running,
so a running task does not get marked as stopped.

Signed-off-by: Michal Fox <me@dualfroz.com>
Link: https://lore.proxmox.com/20261003153820.7-1-me@dualfroz.com
[FE: use file_exists()
     issue warning]
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2026-10-06 14:13:35 +02:00
upstream 0085410b6c Upstream proxmox-git/pve-manager state of the touched files before ac0c87dd37 2026-10-03 15:38:20 +00:00
dualfroz 4be32c6b82 fix #4986: jobs: do not get stuck if the task log is missing
When the scheduler checks whether the last run of a job has finished,
it dies if the task log of that run does not exist. The job is then
skipped with 'could not update job state, skipping - no such task' on
every iteration, so it never runs again until its state file is
cleaned up manually.

The task log can be gone, for example after a crash. If the task is
not running anymore, treat it as stopped with an error status instead,
so that the job gets scheduled again, like Proxmox Backup Server does
since commit 48fbce07 ("fix #4895: scheduled jobs: ignore task-log not
found error").

The check now comes after the one whether the task is still running,
so a running task does not get marked as stopped.

Signed-off-by: Michal Fox <me@dualfroz.com>
2026-10-03 01:07:38 +02:00
upstream 81a3792fe3 Upstream proxmox-git/pve-manager state of the touched files before aeca33cb87 2026-10-03 01:07:38 +02:00