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

Use EPOLL_CLOEXEC to prevent fd leaks. #74691

Merged
merged 3 commits into from Jul 11, 2019

Conversation

cpuguy83
Copy link
Contributor

@cpuguy83 cpuguy83 commented Feb 28, 2019

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind bug

What this PR does / why we need it:

Use EPOLL_CLOEXEC to prevent fd leaks.

Which issue(s) this PR fixes:

Special notes for your reviewer:

There's still an issue with fsnotify which is used in other places.
Reaching out to the maintainer, but he backed out of the project some
time ago and there's no active committers AFAIK.

Does this PR introduce a user-facing change?:

Use O_CLOEXEC to ensure file descriptors do not leak to subprocesses.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 28, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @cpuguy83. Thanks for your PR.

I'm waiting for a kubernetes 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.

@cpuguy83
Copy link
Contributor Author

/sig node

@k8s-ci-robot k8s-ci-robot added sig/node Categorizes an issue or PR as relevant to SIG Node. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 28, 2019
@cpuguy83
Copy link
Contributor Author

/assign @derekwaynecarr

@ddebroy
Copy link
Member

ddebroy commented Feb 28, 2019

/ok-to-test

@k8s-ci-robot k8s-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 28, 2019
@khenidak
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 28, 2019
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. sig/storage Categorizes an issue or PR as relevant to SIG Storage. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 15, 2019
@cpuguy83
Copy link
Contributor Author

/test pull-kubernetes-kubemark-e2e-gce-big

@dims dims added the area/dependency Issues or PRs related to dependency changes label Apr 15, 2019
@dims
Copy link
Member

dims commented May 23, 2019

/priority important-soon
/retest
/milestone v1.15

@timmycarr
Copy link

Hi! Friendly reminder from your release team: we are starting the code freeze for 1.15 tomorrow EOD. Seeing some good progress here, just checking in to see if this is still planned for the 1.15 cycle? See that milestone added a couple of days ago and awaiting a LGTM. Assuming that's the case. Can I get a quick confirmation here?

@soggiest
Copy link

soggiest commented Jun 3, 2019

@dims Is this release blocking? I see you've approved this PR but it is lacking a LGTM label, I'm inclined to move this to 1.16.

@dims
Copy link
Member

dims commented Jun 3, 2019

@soggiest sounds good, my approval is not enough, need folks from sig-node to approve unfortunately :(

@soggiest
Copy link

soggiest commented Jun 3, 2019

/milestone v1.16

@k8s-ci-robot k8s-ci-robot modified the milestones: v1.15, v1.16 Jun 3, 2019
@dims
Copy link
Member

dims commented Jul 8, 2019

/uncc

@derekwaynecarr
Copy link
Member

apologies for the delay, for some reason this PR was lost in my review queue. i assume you were observing leaks from this area, but its not clear at what rate? we should have metrics for this and i am wondering why it hasn't come up prior.

@sjenning can you take a look? i think you were the original author for using memcg notifications in this area, and it would be good for you to weigh in.

@sjenning
Copy link
Contributor

sjenning commented Jul 8, 2019

related fsnotify/fsnotify#219
/lgtm
I don't think we are leaking fd's that I know of but this is good hygiene unless you are intentionally wanting to share fd's with child processes (which we don't).
needs a rebase though.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 8, 2019
@cpuguy83
Copy link
Contributor Author

cpuguy83 commented Jul 8, 2019

Yes, I went on a hunt for possible leaks after a user reported some issues running out of inotify handles (without much to go on to debug with). These are just what I ran across as possible, and unlikely to want to be shared with sub-processes.

@dims
Copy link
Member

dims commented Jul 9, 2019

@cpuguy83 let's rebase and ping folks for approval again :)

This prevents fd's from leaking to subprocesses.
This prevents fd's from leaking to subprocesses.
This prevents fd's from leaking to subprocesses.
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 9, 2019
@derekwaynecarr
Copy link
Member

thanks @cpuguy83 and @sjenning for commenting.

kubelet changes lgtm.

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 9, 2019
@dims
Copy link
Member

dims commented Jul 10, 2019

/assign @thockin @dchen1107

(We need pkg/ OWNERS approval, please see @derekwaynecarr 's /approve above)

@thockin
Copy link
Member

thockin commented Jul 10, 2019

Thanks!

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cpuguy83, derekwaynecarr, thockin

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 10, 2019
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit 514a157 into kubernetes:master Jul 11, 2019
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. area/dependency Issues or PRs related to dependency changes area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", 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. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet