mirror of
https://git.yoctoproject.org/poky
synced 2026-05-09 05:29:32 +00:00
bitbake: prserv/serv: Fix a PID file removal race on prserv stop
A race condition has happened where the exiting server removed the PID file between the existence check and the removal, resulting in a FileNotFoundError exception. The fix is to ignore the FileNotFoundError exception, the existence check is now redundant so remove it to simplify. Fixes [YOCTO #14341] (Bitbake rev: 40d00bf9308e0bf73a00134a99a012a292daa1c5) Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
2689d8cf22
commit
ef88dee4f7
@@ -262,8 +262,11 @@ def stop_daemon(host, port):
|
|||||||
os.kill(pid, signal.SIGTERM)
|
os.kill(pid, signal.SIGTERM)
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
if os.path.exists(pidfile):
|
try:
|
||||||
os.remove(pidfile)
|
os.remove(pidfile)
|
||||||
|
except FileNotFoundError:
|
||||||
|
# The PID file might have been removed by the exiting process
|
||||||
|
pass
|
||||||
|
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
err = str(e)
|
err = str(e)
|
||||||
|
|||||||
Reference in New Issue
Block a user