Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Reset any control plane units that failed to stop. #688

Merged
merged 1 commit into from
Jun 26, 2020

Conversation

a-palchikov
Copy link
Contributor

Backport of #685.

Updates github.com/gravitational/gravity/issues/1209.

// Even if 'systemctl stop' did not fail, the service could have failed stopping
// even though 'stop' is blocking, it does not return an error upon service failing.
// See github.com/gravitational/gravity/issues/1209 for more details
if err := systemctlCmd(ctx, "is-failed", unit); err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I just realized something I missed on the non-backport PR. Since we pass no-block to the underlying systemctl command, will a unit enter the failed state before we check the is-failed status, since presumably the unit is allowed some amount of time to shutdown?

Copy link
Contributor Author

@a-palchikov a-palchikov Jun 23, 2020

Choose a reason for hiding this comment

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

We don't pass no-block to systemctl here - so it should be good given the possibility that dbus command could still fail which we'll address with reconciler loop changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah my bad, I was looking at the wrong function signature when that stood out to me.

* Reset any control plane units that failed to stop.
* Address review comments

Updates github.com/gravitational/gravity/issues/1209.
@a-palchikov a-palchikov merged commit f9a2d18 into master Jun 26, 2020
@a-palchikov a-palchikov deleted the dmitri/1209-reset-failed branch June 26, 2020 09:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants