Skip to content

Commit 1657769

Browse files
authored
Fix parent job sync when parent reaches 100% progress (#6282)
* Fix parent job sync when parent reaches 100% progress When a child job completes and syncs its progress to a parent job, it can set the parent to 100% progress. However, there are situations where a second child job for the same parent job is created after the parent has already reached 100%. This caused a ValueError when creating a ParentJobSync for subsequent child jobs, as the validator required starting_progress < 100.0. This issue was introduced in #6207 (shipped in 2025.10.0) but only became visible in 2025.10.1 with #6195, which started using progress syncs. The bug manifests during Core update rollbacks when a second docker_interface_install job is created after the parent already reached 100% from the first install. Fix by skipping parent job sync setup when the parent is already done or at 100% progress, as there's no value in syncing progress to a completed parent. * Update comment and add debug message
1 parent a8b7923 commit 1657769

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

supervisor/jobs/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,17 @@ def new_job(
327327
if not curr_parent.child_job_syncs:
328328
continue
329329

330+
# HACK: If parent trigger the same child job, we just skip this second
331+
# sync. Maybe it would be better to have this reflected in the job stage
332+
# and reset progress to 0 instead? There is no support for such stage
333+
# information on Core update entities today though.
334+
if curr_parent.done is True or curr_parent.progress >= 100:
335+
_LOGGER.debug(
336+
"Skipping parent job sync for done parent job %s",
337+
curr_parent.name,
338+
)
339+
continue
340+
330341
# Break after first match at each parent as it doesn't make sense
331342
# to match twice. But it could match multiple parents
332343
for sync in curr_parent.child_job_syncs:

0 commit comments

Comments
 (0)