Repository navigation
[16.0-stable] zedmanager: drive purge state machine to completion in doUpdate - #6846
Closed
milan-zededa wants to merge 1 commit into
Closed
milan-zededa wants to merge 1 commit into
milan-zededa wants to merge 1 commit into
Conversation
Fix app instance getting permanently stuck in HALTING state with PurgeInprogress=BringDown during a purge operation. The purge state machine has the following transitions: DownloadAndVerify → BringDown → RecreateVolumes → BringUp The BringDown → RecreateVolumes transition was only implemented in removeAIStatus(), which is called from updateAIStatusUUID() when it observes PurgeInprogress==BringDown. However, doUpdate() also drives the DownloadAndVerify → BringDown transition and calls doRemove() inline. When doRemove() completes synchronously (no domain or network to tear down), doUpdate() falls through with PurgeInprogress still set to BringDown. If no subsequent event triggers updateAIStatusUUID() (e.g. no DomainStatus, AppNetworkStatus, or VolumeRefStatus changes), removeAIStatus() is never called and the state machine stalls. This happens in practice when: 1. A purge counter mismatch is detected on reboot 2. handleCreateAppInstanceStatus calls doUpdate directly 3. The low-priority app boot path (checkLowPriorityApps) calls doUpdate 4. doRemove completes instantly because nothing is running 5. Nothing triggers another status re-evaluation After doRemove() completes, drive the state machine forward to RecreateVolumes and call purgeCmdDone() to persist the purge counter. This ensures the purge completes regardless of which code path invoked doUpdate(), and prevents the purge from being re-detected on subsequent reboots. Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com> (cherry picked from commit b446019) Signed-off-by: Milan Lenco <milan@zededa.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 16.0-stable #6846 +/- ##
===============================================
- Coverage 29.12% 26.89% -2.24%
===============================================
Files 10 25 +15
Lines 1133 4332 +3199
===============================================
+ Hits 330 1165 +835
- Misses 768 2938 +2170
- Partials 35 229 +194 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rene
approved these changes
Oct 25, 2026
Contributor
|
The Eden #6847 carries this same commit plus the #5742 backport, and passes |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Backport of #5618 to
16.0-stable.Clean cherry-pick with
-xofb4460199b2, no conflicts.It is one of three zedmanager purge fixes (together with the backports of
#5742 and #6257) that
TestVMAppPurgeAfterPowerCycleneeds: without them apurge requested while the device is down never completes after it boots.
PR dependencies
None.
How to test and validate this PR
Covered by the evetest test
TestVMAppPurgeAfterPowerCycle(added to16.0-stableby #6842):The test passes only with this PR together with the backports of #5742 (#6847) and #6257 (#6848).
Changelog notes
Fixed application purge not being driven to completion by zedmanager in some cases.
Checklist
For backport PRs (remove it if it's not a backport):
And the last but not least:
check them.