pipework assumes a random process in the namespace is always running
pooya opened this issue · 2 comments
We occasionally run into errors like the following:
RTNETLINK answers: No such process
After some investigation it turns out that pipework chooses a process:
NSPID=$(head -n 1 "$(find "$CGROUPMNT" -name "$GUESTNAME" | head -n 1)/tasks")
as the representative and later tries to put a network interface in the namespace of that process:
ip link set "$GUEST_IFNAME" netns "$NSPID"
But there is no guarantees that the process found is still running (Is it assumed that the process is the founding member of the namespace?). In our case, the process has just died and there is no such process, but if the pid is reused for another process, the interface is placed in an unrelated network namespace.
That's right. And I don't see an easy way to address that.
Keep in mind that pipework is a sidekick tool, intended to work around past limitations of the Docker API. Now that most limitations have been removed (through host networking, overlay networks, and generally speaking, network plugins) I don't intend to add more features to pipework, sorry!
No Worries. Thanks for the clarification.