[bitbake-devel] [PATCH 10/10] prserv/serv: Gracefully handle the PR server exiting quickly

Richard Purdie richard.purdie at linuxfoundation.org
Thu Aug 31 16:38:40 UTC 2017


If the server exits quickly its PID may no longer exist. Handle
this gracefully.

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/prserv/serv.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/prserv/serv.py b/lib/prserv/serv.py
index dfcbd20..6a99728 100644
--- a/lib/prserv/serv.py
+++ b/lib/prserv/serv.py
@@ -492,7 +492,11 @@ def auto_shutdown():
             PRServerConnection(host, port).terminate()
         except:
             logger.critical("Stop PRService %s:%d failed" % (host,port))
-        os.waitpid(singleton.prserv.pid, 0)
+
+        try:
+            os.waitpid(singleton.prserv.pid, 0)
+        except ChildProcessError:
+            pass
         singleton = None
 
 def ping(host, port):
-- 
2.7.4




More information about the bitbake-devel mailing list