mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
kubelet: allow dockershim exec timeouts to be longer than 10s
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
This commit is contained in:
parent
81ad32e3a4
commit
8ef299552b
@ -117,7 +117,7 @@ func (*NativeExecHandler) ExecInContainer(client libdocker.Interface, container
|
|||||||
execTimeout = time.After(timeout)
|
execTimeout = time.After(timeout)
|
||||||
} else {
|
} else {
|
||||||
// skip exec timeout if provided timeout is 0
|
// skip exec timeout if provided timeout is 0
|
||||||
execTimeout = make(chan time.Time, 1)
|
execTimeout = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
ticker := time.NewTicker(2 * time.Second)
|
ticker := time.NewTicker(2 * time.Second)
|
||||||
@ -148,11 +148,15 @@ func (*NativeExecHandler) ExecInContainer(client libdocker.Interface, container
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only limit the amount of InspectExec calls if the exec timeout was not set.
|
||||||
|
// When a timeout is not set, we stop polling the exec session after 5 attempts and allow the process to continue running.
|
||||||
|
if execTimeout == nil {
|
||||||
count++
|
count++
|
||||||
if count == 5 {
|
if count == 5 {
|
||||||
klog.Errorf("Exec session %s in container %s terminated but process still running!", execObj.ID, container.ID)
|
klog.Errorf("Exec session %s in container %s terminated but process still running!", execObj.ID, container.ID)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
<-ticker.C
|
<-ticker.C
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user