AliyunContainerService / pouch

An Efficient Enterprise-class Container Engine
https://pouchcontainer.io
Apache License 2.0
4.64k stars 949 forks source link

fix: makes pouch stop command support timeout value 0 #3029

Closed staugust closed 2 years ago

staugust commented 3 years ago

Ⅰ. Describe what this PR did

Make pouch stop -t 0 ${cid} behaves as its help message describes, that is to say stop container immediately. See https://github.com/moby/moby/blob/68bec0fcf7a5eeb59c027287d06598098edc9f2c/daemon/stop.go#L71

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)

Ⅳ. Describe how to verify it

Here's command to verify it:

cid=$(pouch create -it --net=host --entrypoint=cat ubuntu:bionic)
pouch start ${cid}
time pouch stop -t 0 ${cid}

For now, pouch stop costs about 10 seconds to stop the container that doesn't response to sig-term. With this commit, pouch stops container immediately.

Ⅴ. Special notes for reviews

CLAassistant commented 3 years ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

cxz66666 commented 2 years ago

I already add a pr which add kill command for pouch, after it merge you can simply use pouch kill [id] to stop a container immediately! So I will close this PR