Support spontaneous reboots during artifact script execution
Description
Affects versions
Environment
blocks
is blocked by
Checklist
Activity
eystein.maloy.stenberg August 15, 2019 at 5:49 PM
Makes sense, thanks for the clarification. I think we're probably touching the limits of use cases state scripts can support with delaying updates and should rather support this in a different way (e.g. client API of some sort) to get "proper" support. Something for later, though.
Kristian Amlie August 15, 2019 at 6:16 AM
The latter. It is not possible to separate between a powerloss and a hang or reboot that happens because of a broken update. Therefore the client does the safe thing and fails and rolls back the update if this condition is detected. However, if there are powerlosses in rollback or failure scripts, these will be called again when the device comes on, so that they are guaranteed to have executed.
The exact behavior can be seen here: https://docs.mender.io/2.0/devices/update-modules#power-loss
eystein.maloy.stenberg August 14, 2019 at 6:40 PM
A while since this was implemented, but is the intention that if you're in the middle of a state script when a spontaneous reboot happens, it will call the same state script when it comes back on? This sounds like a good approach.
However, there are a few users reporting that this is not how it behaves. Rather if it spontaneously reboots during a state script execution it will cause the deployment to fail.
Which of these two is the expected behaviour, given the implementation?
eystein.maloy.stenberg February 6, 2018 at 3:45 PM
If this did not make 1.4, then it won't be released with 1.4. So this task can likely be closed (no cherry picks).
Ole Petter Orhagen January 22, 2018 at 1:24 PM
Details
Assignee
Ole Petter OrhagenOle Petter OrhagenReporter
Kristian AmlieKristian AmlieLabels
Story Points
13Priority
MediumSprint
NoneBacklog
yes
Details
Details
Assignee
Reporter
Labels
Story Points
Priority
Sprint
Backlog
Zendesk Support
Linked Tickets
Zendesk Support
Linked Tickets
Zendesk Support

Acceptance criteria
All artifact script execution and results must be recorded in persistent storage, so that a reboot will pick up where it left off
All states and transition context must be recorded in persistent storage, so that a reboot will pick up where it left off.
Upon starting, Mender must check which state it was in and rerun the state if it was not finished
the only guarantee given by Mender is that the state or transition that was currently in progress when the spontaneous reboot happened, will be rerun.
-> Thus the user will have to guarantee that all the functionality required in one state/transition is capable of operating independently of the other states/transitions.
Time that the script was first executed must also be recorded so that timeout may not be artificially lengthened by rebooting