Skip to content
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

Add interlocks to ensure operations are not interrupted #150

Merged
merged 8 commits into from
Dec 12, 2023

Conversation

Oats87
Copy link
Collaborator

@Oats87 Oats87 commented Dec 11, 2023

rancher/rancher#43658

This PR adds interlocks to the system-agent which are used to indicate whether the install script and applyinator should continue.

The first interlock restart-pending indicates to the system-agent that a restart is pending per the install script, and disallows the applyinator from starting to apply a plan when a restart is pending.

The second interlock applyinator-active indicates to the install script that the applyinator is currently reconciling a plan and should not restart the system-agent.

The restart-pending interlock has a timeout feature built into the system-agent which allows the system-agent to ignore the pending restart after 5 minutes, which can be the case when the install script quits prematurely.

…is applying a plan and does not start applying a plan when a restart is pending

Signed-off-by: Chris Kim <oats87g@gmail.com>
Copy link
Contributor

@HarrisonWAffel HarrisonWAffel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few small nits, otherwise makes sense to me as a way to block plan execution right before we restart

pkg/applyinator/applyinator.go Show resolved Hide resolved
pkg/applyinator/applyinator.go Outdated Show resolved Hide resolved
pkg/applyinator/applyinator.go Outdated Show resolved Hide resolved
Signed-off-by: Chris Kim <oats87g@gmail.com>
Signed-off-by: Chris Kim <oats87g@gmail.com>
Signed-off-by: Chris Kim <oats87g@gmail.com>
HarrisonWAffel
HarrisonWAffel previously approved these changes Dec 12, 2023
Signed-off-by: Chris Kim <oats87g@gmail.com>
Signed-off-by: Chris Kim <oats87g@gmail.com>
Signed-off-by: Chris Kim <oats87g@gmail.com>
Signed-off-by: Chris Kim <oats87g@gmail.com>
jakefhyde
jakefhyde previously approved these changes Dec 12, 2023
@Oats87 Oats87 merged commit 806ef42 into rancher:main Dec 12, 2023
1 check passed
gb-123-git added a commit to gb-123-git/rancher-system-agent that referenced this pull request Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants