Skip to content

Fix the forced stop timeout in the docker manager - #95

Merged
f-sommerauer merged 1 commit into
openconfig:masterfrom
f-sommerauer:containerz-stop-timeout
Nov 6, 2026
Merged

f-sommerauer merged 1 commit into
openconfig:masterfrom
f-sommerauer:containerz-stop-timeout

Conversation

@f-sommerauer

Copy link
Copy Markdown
Collaborator

ContainerStop derived the docker stop timeout from the RPC deadline with
int(time.Until(deadline)) / 2. time.Until returns nanoseconds, so the
value was always capped at maximumStopTimeout (10s) regardless of the
deadline. With a deadline that had already passed it became negative,
which docker treats as "wait indefinitely, never SIGKILL", the opposite
of a forced stop.

Compute the timeout in seconds (half of the remaining time, rounded) and
bound it to [minimumStopTimeout=1s, maximumStopTimeout=10s]. Behaviour
without a deadline (engine default) and without force (no SIGKILL) is
unchanged.

@f-sommerauer
f-sommerauer marked this pull request as ready for review November 5, 2026 15:25
@f-sommerauer
f-sommerauer requested a review from alshabib November 5, 2026 17:43
@alshabib

alshabib commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Can resolve the conflicts here?

ContainerStop derived the docker stop timeout from the RPC deadline with
`int(time.Until(deadline)) / 2`. time.Until returns nanoseconds, so the
value was always capped at maximumStopTimeout (10s) regardless of the
deadline. With a deadline that had already passed it became negative,
which docker treats as "wait indefinitely, never SIGKILL", the opposite
of a forced stop.

Compute the timeout in seconds (half of the remaining time, rounded) and
bound it to [minimumStopTimeout=1s, maximumStopTimeout=10s]. Behaviour
without a deadline (engine default) and without force (no SIGKILL) is
unchanged.
@f-sommerauer
f-sommerauer force-pushed the containerz-stop-timeout branch from 0260fa6 to c84153d Compare November 6, 2026 08:30
@f-sommerauer
f-sommerauer merged commit 77b397e into openconfig:master Nov 6, 2026
6 checks passed
@f-sommerauer
f-sommerauer deleted the containerz-stop-timeout branch November 6, 2026 09:36
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