TL;DR: It works as the docs say. But the docs are confusing.
From mender-docs point of view, we use
- StateScriptRetryTimeoutSeconds as the user-specified interval to retry an State Script after special 21 error code is returned
- StateScriptRetryIntervalSeconds for the max window to keep retrying this State Script
The names seem to have been swapped. Internally in the code, we swap them back so that a function called getRetryInterval returns default timeout or user interval (if defined). See code ref 1 and 2.
Furthermore, StateScriptTimeoutSeconds is not documented in State Scripts page, only in Configuration file page, and has no documented default.
We would like to fix it in the next major release.
Reasoning: This will break compatibility with any user using already defining these in their configurations.
ref docs: https://docs.mender.io/1.7/artifacts/state-scripts#retry-later
ref code(1): https://github.com/mendersoftware/mender/blob/6995faa802760c48535dff602d4dad1a6f3801b1/statescript/executor.go#L57
ref code(2): https://github.com/mendersoftware/mender/blob/6995faa802760c48535dff602d4dad1a6f3801b1/mender.go#L261
- The definitions are swapped back in the documentation
- The code logic works as expected
- The default value for StateScriptTimeoutSeconds is something "long enough"
- StateScriptTimeoutSeconds is documented in Satate Scripts page with a given default
- We have a plan to properly inform users about the breaking change