]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
buildpackages: flock must --close
authorLoic Dachary <ldachary@redhat.com>
Sat, 26 Sep 2015 13:20:19 +0000 (15:20 +0200)
committerLoic Dachary <ldachary@redhat.com>
Sat, 26 Sep 2015 13:23:03 +0000 (15:23 +0200)
The process run by flock must not inherit the file descriptor because
this will cause the lock to be held forever should the command survive
the call to flock. This is for instance the case for the ssh-agent.

Signed-off-by: Loic Dachary <loic@dachary.org>
tasks/buildpackages.py

index 422fa26677045b420f57c78d4b5092fb26f0a061..865f661397a06bcf5f2bbd9ea088e50f3445ed97 100644 (file)
@@ -87,7 +87,7 @@ def task(ctx, config):
         else:
             ref = ''
         subprocess.check_call(
-            "flock /tmp/buildpackages " +
+            "flock --close /tmp/buildpackages " +
             "make -C " + d + " " + os.environ['HOME'] + "/.ssh_agent",
             shell=True)
         target = os.path.dirname(urlparse.urlparse(url).path.strip('/'))
@@ -100,7 +100,7 @@ def task(ctx, config):
             'ram': 1024, # MB
             'cpus': 1,
         }, select)
-        cmd = (". " + os.environ['HOME'] + "/.ssh_agent ; flock /tmp/buildpackages make -C " + d +
+        cmd = (". " + os.environ['HOME'] + "/.ssh_agent ; flock --close /tmp/buildpackages make -C " + d +
                " CEPH_GIT_URL=" + teuth_config.get_ceph_git_url() +
                " CEPH_PKG_TYPE=" + gitbuilder.pkg_type +
                " CEPH_OS_TYPE=" + ctx.config['os_type'] +