[Piuparts-commits] [piuparts] 08/12: dwke: acquire 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 e7d9587a6adf20c914da6e607cc85191beef0b2f
Author: Andreas Beckmann <anbe at debian.org>
Date: Wed Oct 4 04:56:11 2017 +0200
dwke: acquire 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 +-
master-bin/detect_well_known_errors.py | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index d6a19f5..3b43fa1 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:
+ * piuparts-report.py, detect_well_known_errors.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/master-bin/detect_well_known_errors.py b/master-bin/detect_well_known_errors.py
index 4708b6c..3634244 100644
--- a/master-bin/detect_well_known_errors.py
+++ b/master-bin/detect_well_known_errors.py
@@ -69,7 +69,9 @@ def process_section(section, config, problem_list,
if not os.access(sectiondir, os.F_OK):
raise MissingSection("", section)
- if True:
+ with open(os.path.join(sectiondir, "master.lock"), "we") as lock:
+ fcntl.flock(lock, fcntl.LOCK_EX)
+
[os.mkdir(x) for x in workdirs if not os.path.exists(x)]
logdict = get_file_dict(workdirs, LOG_EXT)
--
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