Skip to content

Commit feb29da

Browse files
Christopher Brownxoebus
authored andcommitted
lifecycle: decrease stop timeouts
We've seen these timeouts being reached when a job which ignores signals is asked to stop on a heavily loaded machine. It can sometimes take over 5 seconds for a process to dissapear from the process table even when being sent SIGKILL. There isn't much we can do if the machine is so heavily loaded it can't kill processes. We have a hard 30 second limit enforced by monit which we want to adhere to. [finishes #158202290]
1 parent 6716d37 commit feb29da

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v0.9.0
2+
3+
* decrease the time between SIGTERM and SIGKILL to 15 seconds from 20 seconds
4+
15
# v0.8.0
26

37
* add the `bpm run` command for executing processes as short-lived commands

docs/runtime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ terminated.
1818

1919
If you require longer than this then you should use a [drain script][drain] for
2020
your server. The drain script should put your server in such a state that it
21-
can shutdown within 20 seconds. It is acceptable and supported to terminate
21+
can shutdown within 15 seconds. It is acceptable and supported to terminate
2222
your process while running the drain script.
2323

2424
[post-start]:https://bosh.io/docs/post-start.html

src/bpm/commands/stop.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"bpm/runc/lifecycle"
2525
)
2626

27-
const DefaultStopTimeout = 20 * time.Second
27+
const DefaultStopTimeout = 15 * time.Second
2828

2929
func init() {
3030
stopCommand.Flags().StringVarP(&procName, "process", "p", "", "optional process name")

src/bpm/runc/lifecycle/lifecycle.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import (
3535
)
3636

3737
const (
38-
ContainerSigQuitGracePeriod = 5 * time.Second
38+
ContainerSigQuitGracePeriod = 2 * time.Second
3939
ContainerStatePollInterval = 1 * time.Second
4040

4141
ContainerStateRunning = "running"

0 commit comments

Comments
 (0)