8000 Fix potentially unclosed file in runtimeVM#CreateContainer by tedyu · Pull Request #3953 · cri-o/cri-o · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix potentially unclosed file in runtimeVM#CreateContainer #3953

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

Merged
merged 1 commit into from
Jul 15, 2020

Conversation

tedyu
Copy link
Contributor
@tedyu tedyu commented Jul 14, 2020

What type of PR is this?

/kind bug

What this PR does / why we need it:

  f, err := os.OpenFile(c.LogPath(), os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0600)

If the r.task.Create() call fails on line 135, the file would be unclosed.

Which issue(s) this PR fixes:

Fixes #3899

Does this PR introduce a user-facing change?

None

@tedyu tedyu requested review from mrunalp and runcom as code owners July 14, 2020 20:17
@openshift-ci-robot openshift-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Jul 14, 2020
@tedyu
Copy link
Contributor Author
tedyu commented Jul 14, 2020

/cc @haircommander @saschagrunert

@haircommander
Copy link
Member

/approve

thanks @tedyu 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 Jul 14, 2020
@codecov
Copy link
codecov bot commented Jul 14, 2020

Codecov Report

Merging #3953 into master will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #3953      +/-   ##
==========================================
- Coverage   40.53%   40.52%   -0.01%     
==========================================
  Files         109      109              
  Lines        8832     8834       +2     
==========================================
  Hits         3580     3580              
- Misses       4927     4929       +2     
  Partials      325      325              

@tedyu
Copy link
Contributor Author
tedyu commented Jul 15, 2020

/retest

1 similar comment
@tedyu
Copy link
Contributor Author
tedyu commented Jul 15, 2020

/retest

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
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haircommander, saschagrunert, tedyu

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:
  • OWNERS [haircommander,saschagrunert]

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

@@ -141,6 +141,7 @@ func (r *runtimeVM) CreateContainer(c *Container, cgroupParent string) (err erro

select {
case err = <-createdCh:
f.Close()
Copy link
Member

Choose a reason for hiding this comment

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

how is the file closed in the timeout case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think similar handling should be done in timeout case.
Should I include that change in this PR ?

Copy link
Member

Choose a reason for hiding this comment

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

yeah can you include it in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have updated the PR

@saschagrunert
Copy link
Member

/area vm

@openshift-ci-robot
Copy link
8000

@saschagrunert: The label(s) area/vm cannot be applied, because the repository doesn't have them

In response to this:

/area vm

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.

Signed-off-by: Ted Yu <yuzhihong@gmail.com>
@tedyu tedyu force-pushed the create-cont-close branch from 483f656 to 924a8e9 Compare July 15, 2020 14:48
@haircommander
Copy link
Member

LGTM

@fidencio PTAL

@fidencio
Copy link
Contributor

lgtm!

@haircommander
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 15, 2020
@openshift-ci-robot
Copy link

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

Test name Commit Details Rerun command
ci/openshift-jenkins/e2e_crun_cgroupv2 924a8e9 link /test e2e_cgroupv2

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@tedyu
Copy link
Contributor Author
tedyu commented Jul 15, 2020

/retest

@openshift-merge-robot openshift-merge-robot merged commit 339331c into cri-o:master Jul 15, 2020
@fidencio
Copy link
Contributor

/cherry-pick release-1.18

@openshift-cherrypick-robot

@fidencio: only cri-o org members may request cherry picks. You can still do the cherry-pick manually.

In response to this:

/cherry-pick release-1.18

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.

@fidencio
Copy link
Contributor

/cherry-pick release-1.18

@openshift-cherrypick-robot

@fidencio: new pull request created: #3961

In response to this:

/cherry-pick release-1.18

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.

@fidencio
Copy link
Contributor

/cherry-pick release-1.17

@openshift-cherrypick-robot

@fidencio: new pull request created: #3962

In response to this:

/cherry-pick release-1.17

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. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. 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.

File may be left unclosed in runtimeVM#CreateContainer
8 participants
0