From 382924ca272e477a3739aec567fa2177e33da6fa Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Mon, 16 Mar 2015 13:50:56 -0400 Subject: [PATCH] 5448: Clean up old cid files during job start. --- sdk/cli/bin/crunch-job | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job index 92fe886412..cc47bbeb5d 100755 --- a/sdk/cli/bin/crunch-job +++ b/sdk/cli/bin/crunch-job @@ -361,7 +361,7 @@ if (!defined $no_clear_tmp) { # TODO: When #5036 is done and widely deployed, we can get rid of the # regular expression and just unmount everything with type fuse.keep. srun (["srun", "--nodelist=$nodelist", "-D", $ENV{'TMPDIR'}], - ['bash', '-ec', 'mount -t fuse,fuse.keep | awk \'($3 ~ /\ykeep\y/){print $3}\' | xargs -r -n 1 fusermount -u -z; sleep 1; rm -rf $JOB_WORK $CRUNCH_INSTALL $CRUNCH_TMP/task $CRUNCH_TMP/src*']); + ['bash', '-ec', 'mount -t fuse,fuse.keep | awk \'($3 ~ /\ykeep\y/){print $3}\' | xargs -r -n 1 fusermount -u -z; sleep 1; rm -rf $JOB_WORK $CRUNCH_INSTALL $CRUNCH_TMP/task $CRUNCH_TMP/src* $CRUNCH_TMP/*.cid']); exit (1); } while (1) @@ -671,10 +671,6 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++) $slot[$childslot]->{node}->{name}, $slot[$childslot]->{cpu}); - if ($docker_hash) { - $Jobstep->{cidfile} = "$ENV{CRUNCH_TMP}/$Jobstep->{arvados_task}->{uuid}-$Jobstep->{failures}.cid"; - } - my $childpid = fork(); if ($childpid == 0) { @@ -726,8 +722,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) { - $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 "; + my $cidfile = "$ENV{CRUNCH_TMP}/$Jobstep->{arvados_task}->{uuid}-$Jobstep->{failures}.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 "; # Dynamically configure the container to use the host system as its # DNS server. Get the host's global addresses from the ip command, @@ -1069,11 +1066,6 @@ 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 = []; -- 2.30.2