summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2019-12-04 22:38:11 +0000
committerGerrit Code Review <review@openstack.org>2019-12-04 22:38:11 +0000
commit69d93720161b9ad3db09d6bb351d83ccfaf4e429 (patch)
treebc96a646e8175284255546b07f80aa8e7c038554
parentbf2ff9eb1fbcd6de7cb2ba9628d9e9d232cedcdd (diff)
parentc9a57aab082f55d525f003db61290b6ab7437b7c (diff)
downloadoslo-rootwrap-69d93720161b9ad3db09d6bb351d83ccfaf4e429.tar.gz
Merge "reap rootwrap daemon process when it is timeout"5.17.1
-rw-r--r--oslo_rootwrap/client.py9
-rw-r--r--releasenotes/notes/reap-rootwrap-daemon-process-60aebb56d8015484.yaml11
2 files changed, 20 insertions, 0 deletions
diff --git a/oslo_rootwrap/client.py b/oslo_rootwrap/client.py
index ee64b74..0dd0742 100644
--- a/oslo_rootwrap/client.py
+++ b/oslo_rootwrap/client.py
@@ -85,6 +85,15 @@ class Client(object):
(stderr,))
LOG.info("Spawned new rootwrap daemon process with pid=%d",
process_obj.pid)
+
+ def wait_process():
+ return_code = process_obj.wait()
+ LOG.info("Rootwrap daemon process exit with status: %d",
+ return_code)
+
+ reap_process = threading.Thread(target=wait_process)
+ reap_process.daemon = True
+ reap_process.start()
self._manager = ClientManager(socket_path, authkey)
self._manager.connect()
self._proxy = self._manager.rootwrap()
diff --git a/releasenotes/notes/reap-rootwrap-daemon-process-60aebb56d8015484.yaml b/releasenotes/notes/reap-rootwrap-daemon-process-60aebb56d8015484.yaml
new file mode 100644
index 0000000..79bd400
--- /dev/null
+++ b/releasenotes/notes/reap-rootwrap-daemon-process-60aebb56d8015484.yaml
@@ -0,0 +1,11 @@
+---
+fixes:
+ - |
+ Reap the rootwrap daemon process after it is timeout and quit. When the
+ daemon process is timeout, it will kill itself. But the parent doesn't reap
+ it. Fixed this behaviour by adding a thread to wait the process to be done
+ once the daemon is started.
+
+ More info please refer the LP #1850241 [1].
+
+ [1] https://bugs.launchpad.net/oslo.rootwrap/+bug/1850241