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

CRI: Fix StopContainer timeout #44970

Merged

Conversation

Random-Liu
Copy link
Member

@Random-Liu Random-Liu commented Apr 26, 2017

Fixes #44956.

I verified this PR with the example provided in #44956, and now pod deletion will respect grace period timeout:

NAME                         READY     STATUS        RESTARTS   AGE
gracefully-terminating-pod   1/1       Terminating   0          6m

@dchen1107 @yujuhong @feiskyer /cc @kubernetes/sig-node-bugs

@Random-Liu Random-Liu added area/kubelet cherrypick-candidate release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. labels Apr 26, 2017
@Random-Liu Random-Liu added this to the v1.6 milestone Apr 26, 2017
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 26, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@k8s-github-robot k8s-github-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 26, 2017
@Random-Liu
Copy link
Member Author

@k8s-bot unit test this

@dchen1107 dchen1107 added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Apr 26, 2017
ctx, cancel := getContextWithTimeout(time.Duration(timeout) * time.Second)
if timeout == 0 {
// Do not set timeout when timeout is 0.
ctx, cancel = getContextWithCancel()
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't the logic is if timeout==0 for StopContainer, we set the default timeout value? The default one can be r.timeout here

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@Random-Liu Random-Liu force-pushed the fix-stop-container-timeout branch from ae0b912 to 5717b77 Compare April 26, 2017 22:38
@dchen1107
Copy link
Member

Since we have this regression for StopContainer, can we make sure there is no regression for other docker client calls? Especially for docker pull?

@Random-Liu Random-Liu force-pushed the fix-stop-container-timeout branch from 5717b77 to cfd0eff Compare April 26, 2017 22:48
@Random-Liu
Copy link
Member Author

Since we have this regression for StopContainer, can we make sure there is no regression for other docker client calls? Especially for docker pull?

@dchen1107 I went through all CRI functions in CRI client, timeout of other operations are set properly.

@ncdc
Copy link
Member

ncdc commented Apr 27, 2017

@derekwaynecarr @sttts need to pick this

@feiskyer
Copy link
Member

/assign

@feiskyer
Copy link
Member

LGTM.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 27, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Random-Liu, feiskyer

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@feiskyer
Copy link
Member

@Random-Liu I think you should add a release note for this.

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 44970, 43618)

@k8s-github-robot k8s-github-robot merged commit c3df35d into kubernetes:master Apr 27, 2017
@Random-Liu Random-Liu deleted the fix-stop-container-timeout branch April 27, 2017 18:17
@yujuhong
Copy link
Contributor

We need a test :(

k8s-github-robot pushed a commit that referenced this pull request Apr 27, 2017
Automatic merge from submit-queue

Automated cherry pick of #44970

Automated cherry pick of #44970: Fix StopContainer timeout.

```release-note
CRI: respect container's stopping timeout.
```

cc @Random-Liu @dchen1107
@k8s-cherrypick-bot
Copy link

Commit found in the "release-1.6" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked.

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/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants