commit 05f19f2c596149c19f5005b4b31ccfdb11bc388d
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Tue May 26 13:59:42 2020 +0000
Force container deletion if namespace does not exist in service_kill
When a service is stopped using "service_kill" script and the
namespace where the container is running does not exist, the
container process should be forced to stop from the root namespace.
A namespace where a process is running, can be deleted whitout
stopping the mentioned process. "ip netns identify <PID>" then
returns an empty string (root namespace).
If the namespace where a container was executed is deleted,
"service_kill" script should execute a container related command
from the root namespace. To access to the root namespace from
inside a container, running in another namespace, it is necessary
to gain access via "nsenter", specifying the parameter "--all" to
access to all namespaces of the target process.
This patch will prevent an endless loop in Neutron DHCP agent. As
reported in the related bug, when a DHCP agent is resync, the DHCP
helper (metadata proxy) is stopped. In case this process stop raises
an exception (for example if the namespace does not exist), schedules
again a resync, creating an endless loop.
Reviewed: https:/ /review. opendev. org/731120 /git.openstack. org/cgit/ openstack/ tripleo- heat-templates/ commit/ ?id=05f19f2c596 149c19f5005b4b3 1ccfdb11bc388d
Committed: https:/
Submitter: Zuul
Branch: stable/ussuri
commit 05f19f2c596149c 19f5005b4b31ccf db11bc388d
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Tue May 26 13:59:42 2020 +0000
Force container deletion if namespace does not exist in service_kill
When a service is stopped using "service_kill" script and the
namespace where the container is running does not exist, the
container process should be forced to stop from the root namespace.
A namespace where a process is running, can be deleted whitout
stopping the mentioned process. "ip netns identify <PID>" then
returns an empty string (root namespace).
If the namespace where a container was executed is deleted,
"service_kill" script should execute a container related command
from the root namespace. To access to the root namespace from
inside a container, running in another namespace, it is necessary
to gain access via "nsenter", specifying the parameter "--all" to
access to all namespaces of the target process.
This patch will prevent an endless loop in Neutron DHCP agent. As
reported in the related bug, when a DHCP agent is resync, the DHCP
helper (metadata proxy) is stopped. In case this process stop raises
an exception (for example if the namespace does not exist), schedules
again a resync, creating an endless loop.
This patch combines [1] and [2] in this repository. /review. opendev. org/#/c/ 714517/ /review. opendev. org/#/c/ 730657/
[1]https:/
[2]https:/
Change-Id: Ifb7dbfb93a7cf0 b50ef15652d83d8 7f65bdb6221 49d16402c37adce a988b84c53)
Closes-Bug: #1868607
(cherry picked from commit 0bc1383a60c4ab2