-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update-agent: react to persistent deploy failure #286
Conversation
I haven't attempted to review the code in any detail, but the change SGTM. |
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.
OK traced through this code a bit and re-familiarized myself with it. This change overall makes sense to me and the code looks good.
src/update_agent/mod.rs
Outdated
/// is being abandoned. | ||
fn deploy_attempted(&mut self, success: bool) -> Option<Release> { | ||
// Maximum failed deploy attempts before declaring a persistent error. | ||
const MAX_DEPLOY_ATTEMPTS: u8 = 60; |
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.
That seems like a lot - why not 3 or even 1?
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.
Good catch, I botched this. It was supposed to be 60 minutes. Retrying every 5 minutes, the watermark here should be at 12
.
This cap is a bit arbitrary, anything strictly larger than 1 would indeed work.
A single attempt instead would remove the re-entering edge. With the current ticking logic, it could result in an infinite fast-spinning loop where the agent is oscillating between NoNewUpdate
and UpdateAvailable
as fast as it can.
Ok, I manually tested this on top of the current
|
This updates actor logic to use variant discriminants when comparing states.
Pushed a fixup commit to address the comments. |
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.
LGTM!
This augments actor state-machine to prevent locking into a faulty `UpdateAvailable` state. In particular, rpm-ostree may not agree to deploy the currently detected update target. After a finite amount of failed attempts, Zincati now abandons its update target and goes back to the `NoNewUpdate` state, polling Cincinnati again for a new target.
This augments update-agent state-machine to prevent locking into a faulty
UpdateAvailable
state.In particular, rpm-ostree may not agree to deploy the currently
detected update target. After a finite amount of failed attempts,
Zincati now abandons its update target and goes back to the
NoNewUpdate
state, polling Cincinnati again for a new target.Ref: coreos/fedora-coreos-tracker#481
Closes: #288
New state-machine diagram:
![diagram](https://raw.githubusercontent.com/lucab/zincati/fab9350a68a299396a891700f9ce01521384e373/docs/images/zincati-fsm.png)