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

hostport manager clean up host ports #4542

Merged
merged 1 commit into from Feb 6, 2021

Conversation

aojea
Copy link
Contributor

@aojea aojea commented Feb 4, 2021

The host port manager, when Remove the hostport from the system, exists fast if there are no
iptables rules to delete.
However, it was missing to call the method that remove the hostports bound, so there is a possibility that we leak sockets.

Signed-off-by: Antonio Ojea aojea@redhat.com

Thanks to @johnbelamaric
kubernetes/kubernetes#98755 (comment)

/kind bug
/kind cleanup

NONE

The host port manager, when removing hostports, exists fast if
there are no iptables rules to delete.
However, it was missing to call the method that remove the
hostports bound, so there is a possibility that we leak sockets.

Signed-off-by: Antonio Ojea <aojea@redhat.com>
@openshift-ci-robot openshift-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Feb 4, 2021
@openshift-ci-robot
Copy link

Hi @aojea. 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.

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 openshift-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 4, 2021
@aojea
Copy link
Contributor Author

aojea commented Feb 4, 2021

/assign @danwinship
/hold

until the upstream review finish kubernetes/kubernetes#98755

It is a bit ironic, but since Conformance broke due to the bug in hostport, now the fix may get upstream.
However, the removal of dockershim is still scheduled for 1.21, so it may be this code will be backported only to 1.20 and disappears in 1.21 ... who knows 🤷

@openshift-ci-robot
Copy link

@aojea: GitHub didn't allow me to assign the following users: danwinship.

Note that only cri-o members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign @danwinship
/hold

until the upstream review finish kubernetes/kubernetes#98755

It is a bit ironic, but since Conformance broke due to the bug in hostport, now the fix may get upstream.
However, the removal of dockershim is still scheduled for 1.21, so it may be this code will be backported only to 1.20 and disappears in 1.21 ... who knows 🤷

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 openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 4, 2021
@codecov
Copy link

codecov bot commented Feb 4, 2021

Codecov Report

Merging #4542 (dcf651d) into master (c75afa5) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #4542   +/-   ##
=======================================
  Coverage   40.18%   40.18%           
=======================================
  Files         115      115           
  Lines        9327     9327           
=======================================
  Hits         3748     3748           
  Misses       5161     5161           
  Partials      418      418           

@haircommander
Copy link
Member

/ok-to-test

@openshift-ci-robot openshift-ci-robot 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 Feb 4, 2021
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-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 5, 2021
@aojea
Copy link
Contributor Author

aojea commented Feb 5, 2021

/hold cancel
kubernetes patch was approved

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 5, 2021
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
/retest

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 5, 2021
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aojea, 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

@haircommander
Copy link
Member

/test integration_fedora

if len(existingChainsToRemove) == 0 {
return nil
return hm.closeHostports(hostportMappings)
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a return(err) at line https://github.com/cri-o/cri-o/pull/4542/files#diff-1e8c8253b73c319cc3d39e1e6eebdbff23129076dfe7814b74754f640f68b1c5R261 and I think we can leave behind the hostportmappings there too. Would it be better to create a defer function to close them there and to do the unlock too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is an error programming the iptables rules, it will be possible that the iptables rules for the portmaps are still active so we should keep holding the ports and not close them.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 5, 2021

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

Test name Commit Details Rerun command
ci/prow/e2e-gcp dcf651d link /test e2e-gcp
ci/prow/e2e-agnostic dcf651d link /test e2e-agnostic

Full PR test history. Your PR dashboard.

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 Feb 6, 2021

/retest

@openshift-merge-robot openshift-merge-robot merged commit 36c46c1 into cri-o:master Feb 6, 2021
@haircommander
Copy link
Member

/cherry-pick release-1.20

@haircommander
Copy link
Member

/cherry-pick release-1.19

@openshift-cherrypick-robot

@haircommander: new pull request created: #4799

In response to this:

/cherry-pick release-1.20

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-cherrypick-robot

@haircommander: new pull request could not be created: failed to create pull request against cri-o/cri-o#release-1.21 from head openshift-cherrypick-robot:cherry-pick-4542-to-release-1.21: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"No commits between cri-o:release-1.21 and openshift-cherrypick-robot:cherry-pick-4542-to-release-1.21"}],"documentation_url":"https://docs.github.com/rest/reference/pulls#create-a-pull-request"}

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.

@openshift-cherrypick-robot

@haircommander: new pull request created: #4800

In response to this:

/cherry-pick release-1.19

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. 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-none Denotes a PR that doesn't merit a release note.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants