[projects/pld-builder.new] Add separate locking for tasks with prio (-1000,0) and no locking at all for tasks with prio < -1000

arekm arekm at pld-linux.org
Wed Oct 30 13:52:56 CET 2013


commit 8310d5049cd84994b615a948062de522d4cda88c
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Wed Oct 30 13:52:53 2013 +0100

    Add separate locking for tasks with prio (-1000,0) and no locking at all for tasks with prio < -1000. Use -1000 only if really needed like some negative priority job stuck.

 PLD_Builder/rpm_builder.py | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/PLD_Builder/rpm_builder.py b/PLD_Builder/rpm_builder.py
index 9cf80a8..b41517b 100644
--- a/PLD_Builder/rpm_builder.py
+++ b/PLD_Builder/rpm_builder.py
@@ -374,6 +374,12 @@ def main_for(builder):
         f.close()
         l.close()
     else:
+        # be able to avoid locking with very low priority
+        if req.priority > -1000:
+            # allow only one build in given builder at once
+            if not lock.lock("building-high-priority-rpm-for-%s" % config.builder, non_block = 1):
+                return
+
         msg = "HIGH PRIORITY: "
 
     msg += "handling request %s (%d) for %s from %s, priority %s" \
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/8310d5049cd84994b615a948062de522d4cda88c



More information about the pld-cvs-commit mailing list