-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set StopTimeout for compat API if not set by client #19704
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -72,7 +76,8 @@ func (ic *ContainerEngine) createServiceContainer(ctx context.Context, name stri | |||
ReadOnly: true, | |||
ReadWriteTmpFS: false, | |||
// No need to spin up slirp etc. | |||
Net: &entities.NetOptions{Network: specgen.Namespace{NSMode: specgen.NoNetwork}}, | |||
Net: &entities.NetOptions{Network: specgen.Namespace{NSMode: specgen.NoNetwork}}, | |||
StopTimeout: rtc.Engine.StopTimeout, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reporter actually caught it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@InvalidInterrupt PTAL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about it without a fried brain: I am not sure the stop timeout makes that much sense for a service container. There is no workload inside other than catatonit. But catatonit handles SIGTERM just fine so I don't expect any measurable negative performance impact on shut down.
test/system/260-sdnotify.bats
Outdated
run_podman container inspect --format '{{.Config.StopTimeout}}' $service_container | ||
is "$output" "10" "StopTimeout should be initialized to 10" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is getting run eighteen times. Could there maybe be a better place to do this check?
(I'd love to find it myself but am currently rabbitholing into a weird "Closing sdnotify proxy ... unixgram" error)
test/apiv2/20-containers.at
Outdated
@@ -308,6 +308,7 @@ cid_top=$(jq -r '.Id' <<<"$output") | |||
t GET containers/${cid_top}/json 200 \ | |||
.Config.Entrypoint[0]="top" \ | |||
.Config.Cmd='[]' \ | |||
.Config.StopTimeput="10" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo Timeout, I guess this is why the tests fails
Code LGTM |
Code LGTM |
All bud tests are blowing up because of the removal of podmanhello.
|
Currently containers created via DOCKER API without specifying StopTimeout are defaulting to 0 seconds. This change should default them to setting in containers.conf normally 10 seconds. Fixes: containers#19139 Signed-off-by: Daniel J Walsh <[email protected]>
Fixes: containers#19139 Service containers are defaulting to 0 seconds for Timeout rather then the settings in containers.conf. Signed-off-by: Daniel J Walsh <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
@@ -72,7 +76,8 @@ func (ic *ContainerEngine) createServiceContainer(ctx context.Context, name stri | |||
ReadOnly: true, | |||
ReadWriteTmpFS: false, | |||
// No need to spin up slirp etc. | |||
Net: &entities.NetOptions{Network: specgen.Namespace{NSMode: specgen.NoNetwork}}, | |||
Net: &entities.NetOptions{Network: specgen.Namespace{NSMode: specgen.NoNetwork}}, | |||
StopTimeout: rtc.Engine.StopTimeout, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about it without a fried brain: I am not sure the stop timeout makes that much sense for a service container. There is no workload inside other than catatonit. But catatonit handles SIGTERM just fine so I don't expect any measurable negative performance impact on shut down.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhatdan, vrothberg The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I thought the reporter noticed an issue on the service timeout, exiting before the containers and pods had a chance to cleanup. |
Currently containers created via DOCKER API without specifying
StopTimeout are defaulting to 0 seconds. This change should
default them to setting in containers.conf normally 10 seconds.
Fixes: #19139
Set StopTimeout for service-container started under podman kube play
Fixes: #19139
Service containers are defaulting to 0 seconds for Timeout rather then
the settings in containers.conf.
Does this PR introduce a user-facing change?