taskmanager: ConfigUpdateJob stays InProgress forever because edgecore restarts before reporting the Update result
What happened
ConfigUpdateJob stays in InProgress even after the config is updated and edgecore restarts successfully.
The problem happens because keadm config-update restarts edgecore while edgecore is still waiting for the command to finish. When edgecore restarts, the code waiting for keadm config-update is terminated, so the action status is never reported.
A report file is still created at:
/etc/kubeedge/upgrade_report.jsonwith:
"event": "ConfigUpdate"However, after edgecore reconnects, ReportUpgradeStatus only handles NodeUpgradeJob. It does not handle ConfigUpdateJob, so the report is ignored and the job remains InProgress.
The same report file also remains on the node, which causes the same error to appear again on later reconnects.
Expected behavior
After edgecore restarts and reconnects:
- The
ConfigUpdateJobshould be marked asCompletedwhen the update succeeds. - It should be marked as
Failurewhen the update fails. - The report file should be removed after it is processed.
How to reproduce
- Join an edge node using
keadm joinwith systemd. - Create a
ConfigUpdateJob:
apiVersion: operations.kubeedge.io/v1alpha2
kind: ConfigUpdateJob
metadata:
name: config-update-test
spec:
nodeNames:
- "<edge-node>"
updateFields:
modules.edged.tailoredKubeletConfig.imageGCHighThresholdPercent: "90"- Check that
/etc/kubeedge/config/edgecore.yamlis updated. - Check that edgecore restarts.
- Check
/etc/kubeedge/upgrade_report.jsonand confirm it contains:
"event": "ConfigUpdate"- Check the job:
kubectl get configupdatejob config-update-test -o yamlThe job stays in InProgress.
Edgecore also logs:
failed to report upgrade status and run next action
no upgrade record found or invalid info from meta dataPossible fix
A fix could follow the existing NodeUpgradeJob flow:
- Save the
ConfigUpdateJobinformation before running the update action. - Handle
ConfigUpdateinReportUpgradeStatus. - Report the result using
ResourceConfigUpdateJob. - Remove the saved record and
/etc/kubeedge/upgrade_report.jsonafter processing. - Remove stale report files when no matching job is found.
Failures that happen before the restart are not affected by this issue.
Environment
- KubeEdge:
ceb5eacd1 - Kubernetes: any
- OS: Linux with systemd
- Go:
1.25.14
Affected files:
edge/pkg/taskmanager/actions/configupdatejob.goedge/pkg/taskmanager/hub_connected_hooker.gokeadm/cmd/keadm/app/cmd/edge/configupdate.go
Source: kubeedge/kubeedge