这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@LTe
Copy link
Contributor

@LTe LTe commented Apr 28, 2015

When we will use kill command on docker main process will receive
SIGKILL signal. This will result in immediate termination of
processes. We need to send a signal SIGTERM to main process and give
the opportunity to close application in correct way.

dokku Outdated
Copy link
Member

Choose a reason for hiding this comment

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

In practice this does not work consistently. See the open PR for scaling. #1118

Instead I think we want to attempt stop (default timeout is 10 sec) then kill.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@michaelshobbs make sense. So:

docker stop $oldid
sleep $WAIT_FOR_KILL
docker kill $oldid

or just

docker stop $oldid
docker kill $oldid

Copy link
Member

Choose a reason for hiding this comment

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

Just the second one.

From https://docs.docker.com/reference/commandline/cli/#stop

Usage: docker stop [OPTIONS] CONTAINER [CONTAINER...]

Stop a running container by sending SIGTERM and then SIGKILL after a
grace period

  -t, --time=10      Seconds to wait for stop before killing it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@michaelshobbs updated

When we will use `kill` command on `docker` main process will receive
`SIGKILL` signal. This will result in immediate termination of
processes. We need to send a signal `SIGTERM` to main process and give
the opportunity to close application in correct way.
michaelshobbs added a commit that referenced this pull request Apr 29, 2015
Do not kill docker container with SIGKILL
@michaelshobbs michaelshobbs merged commit da92419 into dokku:master Apr 29, 2015
@michaelshobbs
Copy link
Member

I jumped the gun here and missed the change to kill_new(). There is no reason (that I can see) to docker stop a new container that failed CHECKS. @LTe would you mind following up with reverting that particular bit?

@LTe
Copy link
Contributor Author

LTe commented Apr 30, 2015

@michaelshobbs sure, I will create pull request for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants