jenkins-bot has submitted this change and it was merged.

Change subject: Avoid race condition where lock file disappeared from under us
......................................................................


Avoid race condition where lock file disappeared from under us

Change-Id: I26c87c22cefc3a12a195e3c705c3ba945ae8aa23
---
M scap/utils.py
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  20after4: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scap/utils.py b/scap/utils.py
index 5367ec2..cf03eb1 100644
--- a/scap/utils.py
+++ b/scap/utils.py
@@ -276,7 +276,8 @@
         if lock_fd:
             fcntl.lockf(lock_fd, fcntl.LOCK_UN)
             lock_fd.close()
-            os.unlink(filename)
+            if os.path.exists(filename):
+                os.unlink(filename)
 
 
 @contextlib.contextmanager

-- 
To view, visit https://gerrit.wikimedia.org/r/238828
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I26c87c22cefc3a12a195e3c705c3ba945ae8aa23
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/scap
Gerrit-Branch: master
Gerrit-Owner: Chad <[email protected]>
Gerrit-Reviewer: 20after4 <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: Dduvall <[email protected]>
Gerrit-Reviewer: Thcipriani <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to