OCPBUGS-84922: fix: prevent panic on concurrent StopContainer calls#9920
Conversation
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: The label(s) DetailsIn response to this:
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. |
|
@sabujmaity: This pull request references Jira Issue OCPBUGS-84922, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
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 Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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:
|
|
@sabujmaity: This pull request references Jira Issue OCPBUGS-84922, which is invalid:
Comment DetailsIn response to this:
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. |
|
/jira refresh |
|
@sabujmaity: This pull request references Jira Issue OCPBUGS-84922, which is invalid:
Comment DetailsIn response to this:
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. |
|
/kind bug |
|
/ok-to-test LGTM, @cri-o/cri-o-maintainers PTAL |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
5b09212
into
cri-o:release-1.34
|
@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. DetailsIn response to this:
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. |
|
/cherry-pick release-1.33 |
|
@bitoku: #9920 failed to apply on top of branch "release-1.33": DetailsIn response to this:
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. |
/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.gocaused 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:
container.gochanges are identical to OCPBUGS-76451: fix: prevent panic on closed stopTimeoutChan in StopContainer #9799container_test.gowas adapted to fit therelease-1.34 test structure (standalone
It()block vs nestedDescribeon main)