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 cleanup

What this PR does / why we need it:

this is part follow up of #5672, part alternative to #6023.

This came from investigation of #6023. Basically, it seems createdAt is subject to change because we return what is directly in the state. This got me thinking that we shouldn't be updating createdAt, finishedAt or startedAt, as they should be static.

That, paired with the effort in #5672 to reduce the number of new objects that are created, lead to this!

The idea is we know exactly when states change for containers. In UpdateContainerSTatus calls after we catch an exit, we know the time of exit, we know when we created the container and when we started it. Consulting runc update and updating our state can leave us in weird situations (like that in kubernetes/kubernetes#105332 and https://bugzilla.redhat.com/show_bug.cgi?id=2094865).

Overall, this should make the flow simpler, and the number of objects created lower, at the cost of a decently heavy refactor.

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

fix a bug where the status of a container ends up being bogus, causing Kubelet to print `verify ContainerStatus failed" err="status.CreatedAt is not set` repeatedly.

@openshift-ci openshift-ci bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Jul 1, 2022
@openshift-ci openshift-ci bot requested review from QiWang19 and wgahnagl July 1, 2022 21:10
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 1, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haircommander

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:

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 1, 2022
@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 2, 2022
the first thing WaitContainerStopped does is verifyPid(), so we can skip this.

Signed-off-by: Peter Hunt <[email protected]>
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 5, 2022
when a message is being sent over proto, it must not be edited. To circumvent this, the underlying memory section is not updated,
but the whole memory address with a changed copy.

Do this similarly for criStatus, which is a bit more involved, as there are more changing pieces.

In order to do so, we introduce Set{Started,Stopped} calls and wire them into runtime_oci.go. This way, we can return an updated
criStatus, but atomically change it so as to not corrupt proto's view of the world

Signed-off-by: Peter Hunt <[email protected]>
when calling UpdateContainerStatus, in case some other fields get zero'd out

Signed-off-by: Peter Hunt <[email protected]>
@github-actions
Copy link

A friendly reminder that this PR had no activity for 30 days.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 22, 2022
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 27, 2022
@openshift-merge-robot
Copy link
Contributor

@haircommander: PR needs rebase.

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.

@openshift-ci-robot
Copy link

@haircommander: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/kata-jenkins 005589b link true /test kata-containers
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.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 27, 2023

@haircommander: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn 005589b link true /test e2e-aws-ovn
ci/prow/ci-images 005589b link true /test ci-images
ci/prow/periodics-images 005589b link true /test periodics-images
ci/prow/images 005589b link true /test images
ci/prow/ci-e2e 005589b link true /test ci-e2e
ci/prow/ci-fedora-integration 005589b link true /test ci-fedora-integration
ci/prow/ci-rhel-critest 005589b link true /test ci-rhel-critest
ci/prow/ci-rhel-e2e 005589b link true /test ci-rhel-e2e
ci/prow/e2e-gcp-ovn 005589b link true /test e2e-gcp-ovn
ci/prow/ci-crun-e2e 005589b link true /test ci-crun-e2e
ci/prow/ci-e2e-conmonrs 005589b link true /test ci-e2e-conmonrs
ci/prow/ci-cgroupv2-e2e-crun 005589b link true /test ci-cgroupv2-e2e-crun
ci/prow/ci-cgroupv2-e2e 005589b link true /test ci-cgroupv2-e2e
ci/prow/ci-cgroupv2-integration 005589b link true /test ci-cgroupv2-integration
ci/prow/ci-fedora-critest 005589b link true /test ci-fedora-critest
ci/prow/ci-cgroupv2-e2e-features 005589b link true /test ci-cgroupv2-e2e-features
ci/kata-jenkins 005589b link true /test kata-containers
ci/prow/ci-e2e-evented-pleg 005589b link true /test ci-e2e-evented-pleg
ci/prow/ci-fedora-kata 005589b link true /test ci-fedora-kata

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.

@sohankunkerkar sohankunkerkar removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 4, 2023
@sohankunkerkar
Copy link
Member

@haircommander what's the status of this PR? It's good to have these changes.

@haircommander
Copy link
Member Author

@haircommander what's the status of this PR? It's good to have these changes.

yeah they seem like good changes though the PR needs some work. I don't think it's very high priority right now as the underlying issue was resolved

@github-actions
Copy link

A friendly reminder that this PR had no activity for 30 days.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 24, 2023
@kwilczynski
Copy link
Contributor

/remove-lifecycle stale

@openshift-ci openshift-ci bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 27, 2023
@github-actions
Copy link

A friendly reminder that this PR had no activity for 30 days.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 28, 2023
@github-actions
Copy link

Closing this PR since it had no activity in the past 90 days.

@github-actions github-actions bot added the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Mar 27, 2024
@github-actions github-actions bot closed this Mar 27, 2024
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/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. 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.

5 participants