[ARVADOS] created: b306eb48ab12676ffb365ede8197e4f2d7e92011
git at public.curoverse.com
git at public.curoverse.com
Mon Mar 16 09:36:53 EDT 2015
at b306eb48ab12676ffb365ede8197e4f2d7e92011 (commit)
commit b306eb48ab12676ffb365ede8197e4f2d7e92011
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Mon Mar 16 09:40:32 2015 -0400
5448: Don't create new tasks if $main::success is defined. Add failure count
to cidfile and delete cidfile in reapchildren() to fix Docker cidfile collision.
diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job
index 9fb14b1..b3ce782 100755
--- a/sdk/cli/bin/crunch-job
+++ b/sdk/cli/bin/crunch-job
@@ -721,9 +721,9 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++)
$command .= "&& exec arv-mount --by-id --allow-other $ENV{TASK_KEEPMOUNT} --exec ";
if ($docker_hash)
{
- my $cidfile = "$ENV{CRUNCH_TMP}/$ENV{TASK_UUID}.cid";
- $command .= "crunchstat -cgroup-root=/sys/fs/cgroup -cgroup-parent=docker -cgroup-cid=$cidfile -poll=10000 ";
- $command .= "$docker_bin run --rm=true --attach=stdout --attach=stderr --attach=stdin -i --user=crunch --cidfile=$cidfile --sig-proxy ";
+ $Jobstep->{cidfile} = "$ENV{CRUNCH_TMP}/$ENV{TASK_UUID}-$Jobstep->{failures}.cid";
+ $command .= "crunchstat -cgroup-root=/sys/fs/cgroup -cgroup-parent=docker -cgroup-cid=$Jobstep->{cidfile} -poll=10000 ";
+ $command .= "$docker_bin run --rm=true --attach=stdout --attach=stderr --attach=stdin -i --user=crunch --cidfile=$Jobstep->{cidfile} --sig-proxy ";
# Dynamically configure the container to use the host system as its
# DNS server. Get the host's global addresses from the ip command,
@@ -831,7 +831,7 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++)
||
(@slot > @freeslot && $todo_ptr+1 > $#jobstep_todo))
{
- last THISROUND if $main::please_freeze;
+ last THISROUND if $main::please_freeze || defined($main::success);
if ($main::please_info)
{
$main::please_info = 0;
@@ -1065,6 +1065,11 @@ sub reapchildren
push @freeslot, $proc{$pid}->{slot};
delete $proc{$pid};
+ if (defined($Jobstep->{cidfile})) {
+ unlink $Jobstep->{cidfile};
+ delete $Jobstep->{cidfile};
+ }
+
if ($task_success) {
# Load new tasks
my $newtask_list = [];
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list