-
Notifications
You must be signed in to change notification settings - Fork 60
Store installed version as "non current" before installing #1402
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh-oh, the signals test failed.
This is probably fine, but strikes me as an imperfect compromise. Perhaps we should leave some comments to explain the decisions?
@@ -160,6 +160,8 @@ void SotaUptaneClient::finalizeAfterReboot() { | |||
data::InstallationResult SotaUptaneClient::PackageInstallSetResult(const Uptane::Target &target) { | |||
data::InstallationResult result; | |||
Uptane::EcuSerial ecu_serial = uptane_manifest.getPrimaryEcuSerial(); | |||
// load the target in installed versions so that it can be re-accessed later | |||
storage->saveInstalledVersion(ecu_serial.ToString(), target, InstalledVersionUpdateMode::kNone); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it safe to put that in the installedVersions
table if it hasn't been installed yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The api has been designed to allow that. But adding a non-current/non-pending entry via kNone is indeed poorly tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, just checking. Seems fine, then.
Yes the signal tests sometimes hangs like that... The issue is hard to reproduce though. |
Probably in Is it reasonable to add a test for this scenario? How have you been simulating it, anyway? |
Yes, testing is a bit tricky though. For verification, I've built a qemu image with an aktualizr that just throws after the ostree step. |
That's probably fine for now. Maybe for now we should just make a tech debt task to figure out how to test it, and then if you add a small comment about the current risks of the installation interruption, I'll approve. |
So that the metadata can be re-accessed even if the process is interrupted before the end of installation. Signed-off-by: Laurent Bonnans <laurent.bonnans@here.com>
16128a1
to
67c5c58
Compare
Codecov Report
@@ Coverage Diff @@
## master #1402 +/- ##
==========================================
+ Coverage 80.39% 80.41% +0.02%
==========================================
Files 181 181
Lines 10630 10637 +7
==========================================
+ Hits 8546 8554 +8
+ Misses 2084 2083 -1
Continue to review full report at Codecov.
|
So that the metadata can be re-accessed even if the process is interrupted before the end of installation.
In the infamous "error 20" scenario, the update now shows as successful with error code "0". The reason is that aktualizr doesn't report any installation report but backend accepts it because we now report the correct new version.
It's also maybe not ideal as we would maybe want to report some kind of error (should director error on empty installation reports?), but I think it's a step in the good direction.