Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@haircommander
Copy link
Member

What type of PR is this?

/kind bug

What this PR does / why we need it:

Embarrassingly, the main use-case of internal wipe was one that I had not tested appropriately. It turns out, we never actually have any containers wipeIfAppropriate after we call restore.
This is because the managed ns no longer exists (it is in /run, a tmpfs). Even if its not in a tmpfs, it is not correctly mounted on reboot.

this is okay, though. It reduces complexity a bit. Now, instead of using the version_file to determine whether we rebooted, we just have to make sure we call CNI DEL as much as possible if we fail to restore a sandbox.

To do this, we must rework LoadSandbox to return the sandbox in question (as soon as possible, basically after unmarshalling all the data from the config.json), then call networkStop on that sandbox (inside a resource cleaner so we retry if the node is booting up).

As a result of this, we can simplify wipeIfAppropriate. It now must be passed a list of images, but will not need to do any thinking about containers. Another consequence is we can eventually deprecate version_file.

This PR also ignores some error cases that were not useful to log.

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Fix a bug in `internal_wipe` that would mean CNI resources would be leaked across reboots.

@openshift-ci openshift-ci bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels May 14, 2021
@openshift-ci openshift-ci bot requested a review from nalind May 14, 2021 14:51
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 14, 2021
@haircommander haircommander force-pushed the internal-wipe-reboot branch 2 times, most recently from 40a3d8a to 7a926d4 Compare May 14, 2021 16:06
@haircommander
Copy link
Member Author

/retest

Before, we would not actually call CNI DEL on sandboxes that failed to restore.
This was because we iterated through a map of *successfully* restored sandboxed, and checked if they failed.

Instead, we need to rework LoadSandbox a bit to return a sandbox that was loaded.
Even if the restore fails, we can pass the shell of a sandbox to the CNI plugin to best-effort cleanup

Signed-off-by: Peter Hunt <[email protected]>
@haircommander haircommander force-pushed the internal-wipe-reboot branch from 7a926d4 to 1aaf474 Compare May 17, 2021 18:10
@haircommander
Copy link
Member Author

Copy link
Member

@saschagrunert saschagrunert 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
Copy link
Contributor

openshift-ci bot commented May 18, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haircommander, saschagrunert

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

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [haircommander,saschagrunert]

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

@haircommander
Copy link
Member Author

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 18, 2021

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

Test name Commit Details Rerun command
ci/openshift-jenkins/e2e_crun_cgroupv2 1aaf474 link /test e2e_cgroupv2

Full PR test history. Your PR dashboard.

Details

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.

@mrunalp
Copy link
Member

mrunalp commented May 19, 2021

/lgtm

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

/retest

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

3 similar comments
@openshift-bot
Copy link

/retest

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

@openshift-bot
Copy link

/retest

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

@openshift-bot
Copy link

/retest

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

@openshift-merge-robot openshift-merge-robot merged commit e0c0619 into cri-o:master May 20, 2021
@haircommander
Copy link
Member Author

/cherry-pick release-1.21

@openshift-cherrypick-robot

@haircommander: new pull request created: #4928

Details

In response to this:

/cherry-pick release-1.21

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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants