[ARVADOS] created: 1.2.0-39-gb66b029be

Git user git at public.curoverse.com
Wed Sep 12 15:48:00 EDT 2018


        at  b66b029bef5b4b0f54d204318a8928b7a6977219 (commit)


commit b66b029bef5b4b0f54d204318a8928b7a6977219
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date:   Wed Sep 12 15:37:33 2018 -0400

    14203: Mkdir failing with os.ErrExist is not a fatal error
    
    Don't fail CaptureOutput and cancel the container if a Mkdir returns
    os.ErrExist because a directory already exists.  Fixes bcbio failing
    postprocess_variants step.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --git a/services/crunch-run/copier.go b/services/crunch-run/copier.go
index 4c45f6acb..4a6253c45 100644
--- a/services/crunch-run/copier.go
+++ b/services/crunch-run/copier.go
@@ -70,22 +70,22 @@ type copier struct {
 func (cp *copier) Copy() (string, error) {
 	err := cp.walkMount("", cp.ctrOutputDir, limitFollowSymlinks, true)
 	if err != nil {
-		return "", err
+		return "", fmt.Errorf("in walkMount: %v", err)
 	}
 	fs, err := (&arvados.Collection{ManifestText: cp.manifest}).FileSystem(cp.client, cp.keepClient)
 	if err != nil {
-		return "", err
+		return "", fmt.Errorf("creating Collection.FileSystem: %v", err)
 	}
 	for _, d := range cp.dirs {
 		err = fs.Mkdir(d, 0777)
-		if err != nil {
-			return "", err
+		if err != nil && err != os.ErrExist {
+			return "", fmt.Errorf("Could not Mkdir %v: %v", d, err)
 		}
 	}
 	for _, f := range cp.files {
 		err = cp.copyFile(fs, f)
 		if err != nil {
-			return "", err
+			return "", fmt.Errorf("Could not copyFile %v: %v", f, err)
 		}
 	}
 	return fs.MarshalManifest(".")
diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go
index 0a980b9ce..df7b68833 100644
--- a/services/crunch-run/crunchrun.go
+++ b/services/crunch-run/crunchrun.go
@@ -1428,11 +1428,11 @@ func (runner *ContainerRunner) Run() (err error) {
 		// hasn't already been assigned when Run() returns,
 		// this cleanup func will cause Run() to return the
 		// first non-nil error that is passed to checkErr().
-		checkErr := func(e error) {
+		checkErr := func(prefix string, e error) {
 			if e == nil {
 				return
 			}
-			runner.CrunchLog.Print(e)
+			runner.CrunchLog.Printf("%s error: %v", prefix, e)
 			if err == nil {
 				err = e
 			}
@@ -1443,7 +1443,7 @@ func (runner *ContainerRunner) Run() (err error) {
 		}
 
 		// Log the error encountered in Run(), if any
-		checkErr(err)
+		checkErr("Run", err)
 
 		if runner.finalState == "Queued" {
 			runner.UpdateContainerFinal()
@@ -1456,10 +1456,10 @@ func (runner *ContainerRunner) Run() (err error) {
 			// capture partial output and write logs
 		}
 
-		checkErr(runner.CaptureOutput())
-		checkErr(runner.stopHoststat())
-		checkErr(runner.CommitLogs())
-		checkErr(runner.UpdateContainerFinal())
+		checkErr("CaptureOutput", runner.CaptureOutput())
+		checkErr("stopHoststat", runner.stopHoststat())
+		checkErr("CommitLogs", runner.CommitLogs())
+		checkErr("UpdateContainerFinal", runner.UpdateContainerFinal())
 	}()
 
 	err = runner.fetchContainerRecord()

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list