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

Fix forget_grandchild retain condition #1505

Conversation

mgjm
Copy link
Contributor

@mgjm mgjm commented Jul 12, 2023

What type of PR is this?

/kind bug

What this PR does / why we need it:

I think the retain condition in ChildReaper::forget_grandchild was flipped.

The function passed to retain specifies which elements to keep, but the specified condition returned which element we want to remove. (docs)

That results in the removal of all grandchildren except the one we want to forget.

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

I assume that the forget_grandchild function should remove the grandchild with pid == grandchild_pid and not keep it.

There could be existing use cases that depend on the fact, that the ChildReaper forgot the wrong grandchildren by accident.

I'm not sure, but it could be the case that conmon-rs didn't terminate spawned childs on exit because of this and will do this now. This could be a braking change? If this is the case, we should mention it in the release note block below.

Does this PR introduce a user-facing change?

None

@codecov-commenter
Copy link

codecov-commenter commented Jul 12, 2023

Codecov Report

Merging #1505 (94787b5) into main (f132a00) will decrease coverage by 0.18%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1505      +/-   ##
==========================================
- Coverage   34.18%   34.00%   -0.18%     
==========================================
  Files          13       13              
  Lines        1135     1135              
  Branches      392      394       +2     
==========================================
- Hits          388      386       -2     
  Misses        493      493              
- Partials      254      256       +2     

Signed-off-by: Martin Michaelis <code@mgjm.de>
@mgjm mgjm force-pushed the forget-grandchild-retain-condition branch from 225c05f to 94787b5 Compare July 12, 2023 13:00
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 12, 2023

[APPROVALNOTIFIER] This PR is APPROVED

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

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:

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

@saschagrunert
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Jul 12, 2023
@openshift-merge-robot openshift-merge-robot merged commit 4d31e73 into containers:main Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants