mirror of
https://github.com/containers/podman.git
synced 2025-06-21 17:38:12 +08:00
rootless: make sure we only use a single pause process
Currently --tmpdir changes the location of the pause.pid file. this causes issues because the c code in pkg/rootless does not know about that. I tried to fix this[1] by fixing the c code to not use the shortcut. While this fix worked it will result in many pause processes leaking in the integrration tests. Commit ab88632 added this behavior but following the disccusion it was never the intention that we end up having more than one pause process. The issues that was trying to fix was caused by somthing else AFAICT, the main problem seems to be that the pause.pid file parent directory may not be created when we try to create the pid file so it failed with ENOENT. This patch fixes it by creating this directory always and revert the change to no longer depend on the tmpdir value. With this commit we now always use XDG_RUNTIME_DIR/libpod/tmp/pause.pid for all podman processes. This allows the c shortcut to work reliably and should therefore improve perfomance over my other approach. A system test is added to ensure we see the right behavior and that podman system migrate actually stops the pause process. Thanks to Ed Santiago for the improved test to make it work for both `catatonit` and `podman pause`. This should fix the issues with namespace missmatches that we can see in CI as flakes. [1] https://github.com/containers/podman/pull/18057 Fixes #18057 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -30,12 +30,6 @@ func GetRootlessPauseProcessPidPath() (string, error) {
|
||||
return "", fmt.Errorf("GetRootlessPauseProcessPidPath: %w", errNotImplemented)
|
||||
}
|
||||
|
||||
// GetRootlessPauseProcessPidPath returns the path to the file that holds the pid for
|
||||
// the pause process
|
||||
func GetRootlessPauseProcessPidPathGivenDir(unused string) (string, error) {
|
||||
return "", fmt.Errorf("GetRootlessPauseProcessPidPath: %w", errNotImplemented)
|
||||
}
|
||||
|
||||
// GetRuntimeDir returns the runtime directory
|
||||
func GetRuntimeDir() (string, error) {
|
||||
data, err := homedir.GetDataHome()
|
||||
|
Reference in New Issue
Block a user