[PATCH] buildd-uploader: don't kill the lock if not the owner

Sebastian Andrzej Siewior bigeasy at linutronix.de
Wed Aug 4 08:35:21 UTC 2010


The following happens to people which have to upload quite a lot on a
slow uplink:
- buildd-uploader is invoked, starts the upload process and creats a
  lock named buildd-uploader.lock
- a second buildd-uploader instance is invoked. It notices the lock,
  doesn't do a thing except it kills the lock due to the following
  END statement:
  |if (defined($conf) &&
  |      defined($uploader) &&
  |      defined($uploader->get('Uploader Lock')));

  'Uploader Lock' is defined at this point but it is 0 because this
  instance does not own the lock
- a third instance of buildd-uploader is invoked which will upload
  packages.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
---
 bin/buildd-uploader |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/bin/buildd-uploader b/bin/buildd-uploader
index 6f70754..c5dc2da 100755
--- a/bin/buildd-uploader
+++ b/bin/buildd-uploader
@@ -46,5 +46,6 @@ END {
     unlock_file($conf->get('HOME') . "/buildd-uploader")
 	if (defined($conf) &&
 	    defined($uploader) &&
-	    defined($uploader->get('Uploader Lock')));
+	    defined($uploader->get('Uploader Lock')) &&
+	    $uploader->get('Uploader Lock'));
 }
-- 
1.7.1


--HlL+5n6rz5pIUxbD--





More information about the Buildd-tools-devel mailing list