mirror of
https://github.com/kemko/nomad.git
synced 2026-01-11 04:45:42 +03:00
docker: explicit grace period for initial container reconcilation
Ensure we wait for some grace period before killing docker containers that may have launched in earlier nomad restore.
This commit is contained in:
@@ -20,7 +20,17 @@ func (d *Driver) removeDanglingContainersGoroutine() {
|
||||
|
||||
succeeded := true
|
||||
|
||||
timer := time.NewTimer(period)
|
||||
// ensure that we wait for at least a period or creation timeout
|
||||
// for first container GC iteration
|
||||
// The initial period is a grace period for restore allocation
|
||||
// before a driver may kill containers launched by an earlier nomad
|
||||
// process.
|
||||
initialDelay := period
|
||||
if d.config.GC.DanglingContainers.creationTimeout > initialDelay {
|
||||
initialDelay = d.config.GC.DanglingContainers.creationTimeout
|
||||
}
|
||||
|
||||
timer := time.NewTimer(initialDelay)
|
||||
for {
|
||||
select {
|
||||
case <-timer.C:
|
||||
|
||||
Reference in New Issue
Block a user