From ebe5cab0999cf51e99ab66bbbcb2482795c55223 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Fri, 11 May 2018 23:27:24 +0200 Subject: [PATCH] [mod] add warning comment about unconcurrency safe _remove_lock function --- src/yunohost/service.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/yunohost/service.py b/src/yunohost/service.py index 91b060a57..20819ae98 100644 --- a/src/yunohost/service.py +++ b/src/yunohost/service.py @@ -573,6 +573,7 @@ def _give_lock(action, service, p): return son_PID def _remove_lock(PID_to_remove): + # FIXME ironically not concurrency safe because it's not atomic... PIDs = filesystem.read_file(MOULINETTE_LOCK).split("\n") PIDs_to_keep = [ PID for PID in PIDs if int(PID) != PID_to_remove ]