Skip to content

OCPBUGS-84922: fix: prevent panic on concurrent StopContainer calls#9920

Merged
openshift-merge-bot[bot] merged 1 commit into
cri-o:release-1.34from
sabujmaity:cherry-pick-9799-to-release-1.34
May 5, 2026
Merged

OCPBUGS-84922: fix: prevent panic on concurrent StopContainer calls#9920
openshift-merge-bot[bot] merged 1 commit into
cri-o:release-1.34from
sabujmaity:cherry-pick-9799-to-release-1.34

Conversation

@sabujmaity

@sabujmaity sabujmaity commented May 4, 2026

Copy link
Copy Markdown
Contributor

/kind bug

What this PR does / why we need it:
Manual cherry-pick of #9799 to release-1.34. The automated cherry-pick (#9814) failed due to a merge conflict in container_test.go caused by structural differences on the 1.34 branch.

Which issue(s) this PR fixes:
Fixes OCPBUGS-84922 (depends on OCPBUGS-76451)

Special notes for reviewer:

Fix a panic caused by concurrent StopContainer calls racing to send on an already-closed channel.

Add a stopDone boolean guard to the Container struct. When
SetAsDoneStopping closes the stopTimeoutChan, it also sets stopDone.
WaitOnStopTimeout checks this flag and returns early, preventing a
panic from sending on a closed channel when a second StopContainer
call arrives after the first has completed.

This is a manual cherry-pick of cri-o#9799 to release-1.34, adapted for
the branch's test file structure.

Signed-off-by: Sabuj Maity <samaity@redhat.com>
@sabujmaity sabujmaity requested a review from mrunalp as a code owner May 4, 2026 09:07
@openshift-ci-robot openshift-ci-robot added the jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. label May 4, 2026
@openshift-ci openshift-ci Bot added the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label May 4, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 4, 2026
@openshift-ci

openshift-ci Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

@sabujmaity: The label(s) kind/cherry-pick cannot be applied, because the repository doesn't have them.

Details

In response to this:

/kind cherry-pick

What this PR does / why we need it:
Manual cherry-pick of #9799 to release-1.34. The automated cherry-pick
(#9814) failed due to a merge conflict in container_test.go caused
by structural differences on the 1.34 branch.

Which issue(s) this PR fixes:
Fixes OCPBUGS-84922 (depends on OCPBUGS-76451)

Special notes for your reviewer:

Fix a panic caused by concurrent StopContainer calls racing to send
on an already-closed channel.

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-sigs/prow repository.

@openshift-ci openshift-ci Bot requested review from QiWang19 and hasan4791 May 4, 2026 09:07
@openshift-ci openshift-ci Bot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label May 4, 2026
@openshift-ci-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label May 4, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@sabujmaity: This pull request references Jira Issue OCPBUGS-84922, which is invalid:

  • expected Jira Issue OCPBUGS-84922 to depend on a bug in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but no dependents were found

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

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

/kind cherry-pick

What this PR does / why we need it:
Manual cherry-pick of #9799 to release-1.34. The automated cherry-pick
(#9814) failed due to a merge conflict in container_test.go caused
by structural differences on the 1.34 branch.

Which issue(s) this PR fixes:
Fixes OCPBUGS-84922 (depends on OCPBUGS-76451)

Special notes for your reviewer:

Fix a panic caused by concurrent StopContainer calls racing to send
on an already-closed channel.

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 openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented May 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 011f6d57-236f-4f3a-a4bb-73b1423b7eea

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci

openshift-ci Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Hi @sabujmaity. Thanks for your PR.

I'm waiting for a cri-o member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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-sigs/prow repository.

@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 4, 2026
@codecov

codecov Bot commented May 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.93%. Comparing base (78668a6) to head (5024377).
⚠️ Report is 2 commits behind head on release-1.34.

Additional details and impacted files
@@               Coverage Diff                @@
##           release-1.34    #9920      +/-   ##
================================================
- Coverage         66.74%   63.93%   -2.81%     
================================================
  Files               204      204              
  Lines             28513    28515       +2     
================================================
- Hits              19030    18231     -799     
- Misses             7860     8664     +804     
+ Partials           1623     1620       -3     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@openshift-ci openshift-ci Bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels May 4, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@sabujmaity: This pull request references Jira Issue OCPBUGS-84922, which is invalid:

  • expected dependent Jira Issue OCPBUGS-76451 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is ON_QA instead

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

Details

In response to this:

/kind bug

What this PR does / why we need it:
Manual cherry-pick of #9799 to release-1.34. The automated cherry-pick
(#9814) failed due to a merge conflict in container_test.go caused
by structural differences on the 1.34 branch.

Which issue(s) this PR fixes:
Fixes OCPBUGS-84922 (depends on OCPBUGS-76451)

Special notes for reviewer:

Fix a panic caused by concurrent StopContainer calls racing to send
on an already-closed channel.

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 openshift-eng/jira-lifecycle-plugin repository.

@sabujmaity

Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown

@sabujmaity: This pull request references Jira Issue OCPBUGS-84922, which is invalid:

  • expected dependent Jira Issue OCPBUGS-76451 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is ON_QA instead

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

Details

In response to this:

/jira 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 openshift-eng/jira-lifecycle-plugin repository.

@sabujmaity

Copy link
Copy Markdown
Contributor Author

/kind bug

@openshift-ci openshift-ci Bot added the kind/bug Categorizes issue or PR as related to a bug. label May 4, 2026
@haircommander

Copy link
Copy Markdown
Member

/ok-to-test
/approve

LGTM, @cri-o/cri-o-maintainers PTAL

@openshift-ci openshift-ci Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 4, 2026
@openshift-ci

openshift-ci Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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 May 4, 2026
@bitoku

bitoku commented May 5, 2026

Copy link
Copy Markdown
Contributor

/lgtm
/retest

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 5, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit 5b09212 into cri-o:release-1.34 May 5, 2026
52 of 55 checks passed
@openshift-ci-robot

Copy link
Copy Markdown

@sabujmaity: Jira Issue OCPBUGS-84922: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-84922 has been moved to the MODIFIED state.

Details

In response to this:

/kind bug

What this PR does / why we need it:
Manual cherry-pick of #9799 to release-1.34. The automated cherry-pick (#9814) failed due to a merge conflict in container_test.go caused by structural differences on the 1.34 branch.

Which issue(s) this PR fixes:
Fixes OCPBUGS-84922 (depends on OCPBUGS-76451)

Special notes for reviewer:

Fix a panic caused by concurrent StopContainer calls racing to send on an already-closed channel.

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 openshift-eng/jira-lifecycle-plugin repository.

@bitoku

bitoku commented May 5, 2026

Copy link
Copy Markdown
Contributor

/cherry-pick release-1.33

@openshift-cherrypick-robot

Copy link
Copy Markdown

@bitoku: #9920 failed to apply on top of branch "release-1.33":

Applying: fix: prevent panic on concurrent StopContainer calls
Using index info to reconstruct a base tree...
M	internal/oci/container.go
M	internal/oci/container_test.go
Falling back to patching base and 3-way merge...
Auto-merging internal/oci/container_test.go
Auto-merging internal/oci/container.go
CONFLICT (content): Merge conflict in internal/oci/container.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 fix: prevent panic on concurrent StopContainer calls

Details

In response to this:

/cherry-pick release-1.33

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-sigs/prow 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. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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