libnetwork: avoid restarting rootless helper during teardown - #1067
Open
shrevid03 wants to merge 1 commit into
Open
libnetwork: avoid restarting rootless helper during teardown#1067shrevid03 wants to merge 1 commit into
shrevid03 wants to merge 1 commit into
Conversation
Signed-off-by: Shreya Vidyadhar Keshatti <shrevidh03@gmail.com>
shrevid03
force-pushed
the
fix-rootless-teardown-restart-pr
branch
from
August 11, 2026 19:47
1a58db1 to
3fd162d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Avoid restarting or recreating the rootless network helper during teardown.
Teardown()currently uses the samegetOrCreateNetns()path asSetup()andRun(). If the rootless network namespace still exists but the helper processhas already exited, that path checks the stale helper PID and can fall through
to starting the helper again.
During an orderly systemd user-manager shutdown, starting a new helper scope can
fail because the shutdown transaction is already queued.
This change adds an explicit create/non-create mode:
Setup()andRun()retain the existing create/recovery behavior.Teardown()only uses an existing network namespace and does not recreate orrestart the rootless helper.
Related to podman-container-tools/podman#29419.
Testing
Added
Test_getOrCreateNetnsNoCreateDoesNotRestartHelper.The test creates an existing network namespace reference with a stale helper PID
and verifies that
getOrCreateNetns(false)returns the existing namespacewithout attempting to restart the helper.
Verified with:
go test ./libnetwork/internal/rootlessnetns -count=1git diff --checkI reproduced the shutdown failure on a Fedora CoreOS 44 aarch64 Podman Machine
VM using Podman 6.0.2, Netavark 2.0.0, and Aardvark DNS 2.0.0 with a rootless
Quadlet container on a custom bridge network.
With this change, the rootless-netns teardown path no longer attempts to
restart the dead rootless network helper.
Scope
While validating the full shutdown path, I also identified a separate
Netavark/Aardvark teardown path that can attempt to restart a dead
aardvark-dnsprocess.That behavior is outside the scope of this PR; this change is intentionally
limited to the rootless-netns teardown behavior in
common/libnetwork.