Cleanup disposable on failed startup#847
Conversation
On "cleanup()" of a disposable with "auto_cleanup" enabled, if the state is: - Running: "_auto_cleanup" is called by the event "domain-shutdown" and not on "cleanup()", to avoid recalling it which would cause problems; - Halted: "_auto_cleanup" should be called if domain is not running, but that check is unreliable due to many moving parts, so "DispVM.start" should contain a "cleanup(force=True)" because in that case, we are sure to certain degree that it works, per my tests. Bug introduced on commit f1cbf21, which did not enforce "_auto_cleanup" on "DispVM.start" For: QubesOS#748 Fixes: QubesOS/qubes-issues#10928
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #847 +/- ##
==========================================
- Coverage 70.39% 70.33% -0.07%
==========================================
Files 61 61
Lines 14169 14167 -2
==========================================
- Hits 9974 9964 -10
- Misses 4195 4203 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
I have two ideas of why this bug was not discovered sooner:
Now to tests:
|
cb5d91f to
0995216
Compare
|
openQArun TEST=system_tests_dispvm |
OpenQA test summaryComplete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2026072219-devel&flavor=pull-requests Test run included the following:
New failures, excluding unstableCompared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2026050504-devel&flavor=update
Failed tests14 failures
Fixed failuresCompared to: https://openqa.qubes-os.org/tests/176874#dependencies 27 fixed
Unstable testsDetails
Performance TestsPerformance degradation:42 performance degradations
Remaining performance tests:69 tests
|
0995216 to
005120a
Compare
The "request_mem" is done very early on "QubesVM.start", the error handling doesn't have "self.kill" as the domain is not running yet, and therefore it was skipping "_auto_cleanup". Make sure that early startup failures are property handled, not remaining disposable in the domains collection nor in the preload-dispvm list.
005120a to
f296a88
Compare
|
openQArun TEST=system_tests_dispvm |
On "cleanup()" of a disposable with "auto_cleanup" enabled, if the state is:
Bug introduced on commit f1cbf21, which did not enforce "_auto_cleanup" on "DispVM.start"
For: #748
Fixes: QubesOS/qubes-issues#10928
Tested locally, it works.