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

Bug 1965992: Gracefully shutdown taking around 6-7 mins (libvirt provider) #2631

Merged

Conversation

jkyros
Copy link
Contributor

@jkyros jkyros commented Jun 21, 2021

The machine config daemon's SIGTERM protection was not being removed on
rebootless updates.The existing logic made sense before rebootless updates
were a thing, but now if an update happens and we don't reboot, the MCD
protects itself from SIGTERM forever.

Also, the sequence of functions triggerUpdateWithmachineConfig->
update->performPostConfigChangeAction is recursive, so if we put the
work from #2395 back in to solve this, or try to use the mutex "properly" we'll
potentially deadlock on ourselves under the right conditions.

  • This PR removes an if condition so the SIGTERM protection is removed
    on a successful rebootless update and also adds some logging messages to make
    it more apparent when the protection is being added/removed.

  • Long term we should figure out the desired behavior and "proper" way to
    organize this (maybe flatten it into a loop and get rid of the recursion, maybe
    decide to just stop after one update round without recursing, etc), but for right
    now we at least need to fix the SIGTERM handler because we're negatively
    impacting upgrades and rebootless changes.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1965992
Fixes some cases of: https://bugzilla.redhat.com/show_bug.cgi?id=1927041

@openshift-ci openshift-ci bot added the bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. label Jun 21, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 21, 2021

@jkyros: This pull request references Bugzilla bug 1965992, which is invalid:

  • expected the bug to target the "4.9.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1965992: Gracefully shutdown taking around 6-7 mins (libvirt provider)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot added the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Jun 21, 2021
@openshift-ci openshift-ci bot requested review from sinnykumari and yuqi-zhang June 21, 2021 16:12
@jkyros
Copy link
Contributor Author

jkyros commented Jun 21, 2021

/bugzilla refresh

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 21, 2021

@jkyros: This pull request references Bugzilla bug 1965992, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.9.0) matches configured target release for branch (4.9.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @mike-nguyen

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Jun 21, 2021
@openshift-ci openshift-ci bot requested a review from mike-nguyen June 21, 2021 20:37
@sinnykumari
Copy link
Contributor

/retest

@@ -155,6 +155,7 @@ func (dn *Daemon) performPostConfigChangeAction(postConfigChangeActions []string
}

// currentConfig != desiredConfig, kick off an update
// TODO: this is recursive back to update(), and now that we do rebootless updates we need to think about this
Copy link
Contributor

Choose a reason for hiding this comment

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

This function will usually get called if something in between got changed that lead to a generation of a new config like a new MachineConfig got applied while update was already in progress. This is to make sure that we always update node to desired config.

In regular flow, following will be called.

if inDesiredConfig {
		return nil
	}

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if we really need this comment being added.

Copy link
Contributor

Choose a reason for hiding this comment

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

would prefer card over in-code to-dos, agree with sinny to remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, todo has been removed.

@sinnykumari
Copy link
Contributor

Overall LGTM

The machine-config-daemon gets stuck blocking SIGTERM on rebootless
updatesbecause it only removes its SIGTERM protection when it reboots
or when it encounters an error in the triggerUpdateWithmachineConfig->
update->performPostConfigChangeAction cycle.

This changes the behavior such that it will remove the protection on
a successful rebootless update and adds some logging messages so it's
more clear when it starts and stops protecting itself.
@jkyros jkyros force-pushed the bug-1695992-sigint-lock branch from 2f00d1e to 7b720c3 Compare June 22, 2021 17:32
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 22, 2021
Copy link
Contributor

@yuqi-zhang yuqi-zhang left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 22, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 22, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jkyros, sinnykumari, yuqi-zhang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [sinnykumari,yuqi-zhang]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 23, 2021

@jkyros: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-vsphere-upgrade 7b720c3 link /test e2e-vsphere-upgrade
ci/prow/e2e-aws-disruptive 7b720c3 link /test e2e-aws-disruptive

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 4a1c9df into openshift:master Jun 23, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 23, 2021

@jkyros: All pull requests linked via external trackers have merged:

Bugzilla bug 1965992 has been moved to the MODIFIED state.

In response to this:

Bug 1965992: Gracefully shutdown taking around 6-7 mins (libvirt provider)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@praveenkumar
Copy link
Contributor

/cherry-pick release-4.8

@openshift-cherrypick-robot

@praveenkumar: new pull request created: #2636

In response to this:

/cherry-pick release-4.8

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jkyros
Copy link
Contributor Author

jkyros commented Aug 19, 2021

/cherry-pick release-4.7

@openshift-cherrypick-robot

@jkyros: new pull request created: #2727

In response to this:

/cherry-pick release-4.7

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants