[ARVADOS] created: 90fd1991d4cbec8ee348748ac432ad608092dfe7
git at public.curoverse.com
git at public.curoverse.com
Fri May 29 12:37:40 EDT 2015
at 90fd1991d4cbec8ee348748ac432ad608092dfe7 (commit)
commit 90fd1991d4cbec8ee348748ac432ad608092dfe7
Author: Tom Clegg <tom at curoverse.com>
Date: Fri May 29 12:35:51 2015 -0400
6146: Emit a log message if we get SIGPIPE while extracting our git archive.
diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job
index 0fbdb82..52adb60 100755
--- a/sdk/cli/bin/crunch-job
+++ b/sdk/cli/bin/crunch-job
@@ -2083,19 +2083,26 @@ if (readlink ("$destdir.archive_hash") eq $archive_hash && -d $destdir) {
unlink "$destdir.archive_hash";
mkdir $destdir;
-warn "Extracting archive: $archive_hash\n";
-if (!open(TARX, "|-", "tar", "-xC", $destdir)) {
- die "Error launching 'tar -xC $destdir': $!";
-}
-# If we send too much data to tar in one write (> 4-5 MiB), it stops, and we
-# get SIGPIPE. We must feed it data incrementally.
-my $tar_input;
-while (read(DATA, $tar_input, 65536)) {
- print TARX $tar_input;
-}
-if(!close(TARX)) {
- die "'tar -xC $destdir' exited $?: $!";
-}
+do {
+ my $handler = sub {
+ my $signal = shift;
+ die "Received SIG$signal while extracting archive";
+ };
+ local $SIG{PIPE} = $handler;
+ warn "Extracting archive: $archive_hash\n";
+ if (!open(TARX, "|-", "tar", "-xC", $destdir)) {
+ die "Error launching 'tar -xC $destdir': $!";
+ }
+ # If we send too much data to tar in one write (> 4-5 MiB), it stops, and we
+ # get SIGPIPE. We must feed it data incrementally.
+ my $tar_input;
+ while (read(DATA, $tar_input, 65536)) {
+ print TARX $tar_input;
+ }
+ if(!close(TARX)) {
+ die "'tar -xC $destdir' exited $?: $!";
+ }
+};
mkdir $install_dir;
commit 1ec1d552c77e18e2912e400ae395ca00f4e51c3c
Author: Tom Clegg <tom at curoverse.com>
Date: Fri May 29 12:02:03 2015 -0400
In install script, log archive hash before running tar. refs #6146
diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job
index 5414033..0fbdb82 100755
--- a/sdk/cli/bin/crunch-job
+++ b/sdk/cli/bin/crunch-job
@@ -2083,6 +2083,7 @@ if (readlink ("$destdir.archive_hash") eq $archive_hash && -d $destdir) {
unlink "$destdir.archive_hash";
mkdir $destdir;
+warn "Extracting archive: $archive_hash\n";
if (!open(TARX, "|-", "tar", "-xC", $destdir)) {
die "Error launching 'tar -xC $destdir': $!";
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list