[Piuparts-commits] [piuparts] 09/12: p-a: aquire master.lock for the current section (blocking)

Holger Levsen holger at layer-acht.org
Wed Oct 11 14:58:45 UTC 2017


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch develop
in repository piuparts.

commit fa25b72e0b31264844de3cead75a14b42e74e8f1
Author: Andreas Beckmann <anbe at debian.org>
Date:   Wed Oct 4 05:12:03 2017 +0200

    p-a: aquire master.lock for the current section (blocking)
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 debian/changelog    | 2 +-
 piuparts-analyze.py | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 3b43fa1..5b33a39 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,7 +7,7 @@ piuparts (0.83) UNRELEASED; urgency=medium
     - Use test_versions() in all places referring to a piuparts test.
     - Set test_versions while loading versions from the final target distro.
     - Use the actual package versions for resolving the "outdated" state.
-  * piuparts-report.py, detect_well_known_errors.py:
+  * piuparts-report.py, detect_well_known_errors.py, piuparts-analyze.py:
     - Use global locks to allow only one running instance of each script.
     - Acquire section locks to prevent concurrent processing of a section,
       including piuparts-master access.
diff --git a/piuparts-analyze.py b/piuparts-analyze.py
index ea18dad..9844674 100644
--- a/piuparts-analyze.py
+++ b/piuparts-analyze.py
@@ -36,6 +36,7 @@ import sys
 import re
 import shutil
 import subprocess
+import fcntl
 
 import debianbts
 import apt_pkg
@@ -290,7 +291,10 @@ def mark_logs_with_reported_bugs():
 
 
 def main():
-    mark_logs_with_reported_bugs()
+    with open("master.lock", "we") as lock:
+        fcntl.flock(lock, fcntl.LOCK_EX)
+
+        mark_logs_with_reported_bugs()
 
     piupartsbts.print_stats()
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git



More information about the Piuparts-commits mailing list