[ARVADOS] updated: 17c87ca0bd401020f80576fe340b78f43500c011

Git user git at public.curoverse.com
Tue Mar 1 15:34:18 EST 2016


Summary of changes:
 services/crunch-run/crunchrun.go      | 22 ++++++++--------------
 services/crunch-run/crunchrun_test.go |  4 ++++
 services/crunch-run/upload.go         |  2 +-
 3 files changed, 13 insertions(+), 15 deletions(-)

       via  17c87ca0bd401020f80576fe340b78f43500c011 (commit)
      from  a56f0f66cdff32b44b222eed178f64e6483e518e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 17c87ca0bd401020f80576fe340b78f43500c011
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Tue Mar 1 15:34:15 2016 -0500

    8015: Fix typos in error reporting.  Fix tests.

diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go
index 64f0d77..01edb0a 100644
--- a/services/crunch-run/crunchrun.go
+++ b/services/crunch-run/crunchrun.go
@@ -120,7 +120,7 @@ type ContainerRunner struct {
 
 // SetupSignals sets up signal handling to gracefully terminate the underlying
 // Docker container and update state when receiving a TERM, INT or QUIT signal.
-func (runner *ContainerRunner) SetupSignals() error {
+func (runner *ContainerRunner) SetupSignals() {
 	runner.SigChan = make(chan os.Signal, 1)
 	signal.Notify(runner.SigChan, syscall.SIGTERM)
 	signal.Notify(runner.SigChan, syscall.SIGINT)
@@ -138,8 +138,6 @@ func (runner *ContainerRunner) SetupSignals() error {
 			}
 		}
 	}(runner.SigChan)
-
-	return nil
 }
 
 // LoadImage determines the docker image id from the container record and
@@ -355,12 +353,12 @@ func (runner *ContainerRunner) ProcessDockerAttach(containerReader io.Reader) {
 
 			closeerr := runner.Stdout.Close()
 			if closeerr != nil {
-				runner.CrunchLog.Printf("While closing stdout logs: %v", readerr)
+				runner.CrunchLog.Printf("While closing stdout logs: %v", closeerr)
 			}
 
 			closeerr = runner.Stderr.Close()
 			if closeerr != nil {
-				runner.CrunchLog.Printf("While closing stderr logs: %v", readerr)
+				runner.CrunchLog.Printf("While closing stderr logs: %v", closeerr)
 			}
 
 			runner.loggingDone <- true
@@ -380,7 +378,7 @@ func (runner *ContainerRunner) AttachStreams() (err error) {
 	containerReader, err = runner.Docker.AttachContainer(runner.ContainerID,
 		&dockerclient.AttachOptions{Stream: true, Stdout: true, Stderr: true})
 	if err != nil {
-		return fmt.Errorf("While attaching container logs: %v", err)
+		return fmt.Errorf("While attaching container stdout/stderr streams: %v", err)
 	}
 
 	runner.loggingDone = make(chan bool)
@@ -419,9 +417,8 @@ func (runner *ContainerRunner) StartContainer() (err error) {
 	hostConfig := &dockerclient.HostConfig{Binds: runner.Binds,
 		LogConfig: dockerclient.LogConfig{Type: "none"}}
 
-	runner.AttachStreams()
+	err = runner.AttachStreams()
 	if err != nil {
-		return fmt.Errorf("While attaching streams: %v", err)
 		return err
 	}
 
@@ -604,7 +601,7 @@ func (runner *ContainerRunner) Run() (err error) {
 	if hosterr != nil {
 		runner.CrunchLog.Printf("Error getting hostname '%v'", hosterr)
 	} else {
-		runner.CrunchLog.Printf("Executing on host '%s'", runner.ContainerRecord.UUID, hostname)
+		runner.CrunchLog.Printf("Executing on host '%s'", hostname)
 	}
 
 	var runerr, waiterr error
@@ -647,7 +644,7 @@ func (runner *ContainerRunner) Run() (err error) {
 			if runerr != nil {
 				err = runerr
 			} else if waiterr != nil {
-				err = runerr
+				err = waiterr
 			} else if logerr != nil {
 				err = logerr
 			} else if updateerr != nil {
@@ -662,10 +659,7 @@ func (runner *ContainerRunner) Run() (err error) {
 	}
 
 	// (1) setup signal handling
-	err = runner.SetupSignals()
-	if err != nil {
-		return fmt.Errorf("While setting up signal handling: %v", err)
-	}
+	runner.SetupSignals()
 
 	// (2) check for and/or load image
 	err = runner.LoadImage()
diff --git a/services/crunch-run/crunchrun_test.go b/services/crunch-run/crunchrun_test.go
index bf75e7f..53cdbbc 100644
--- a/services/crunch-run/crunchrun_test.go
+++ b/services/crunch-run/crunchrun_test.go
@@ -463,6 +463,8 @@ func FullRunHelper(c *C, record string, fn func(t *TestDockerClient)) (api *ArvT
 
 	api = &ArvTestClient{ContainerRecord: rec}
 	cr = NewContainerRunner(api, &KeepTestClient{}, docker, "zzzzz-zzzzz-zzzzzzzzzzzzzzz")
+	am := &ArvMountCmdLine{}
+	cr.RunArvMount = am.ArvMountTest
 
 	err = cr.Run()
 	c.Check(err, IsNil)
@@ -601,6 +603,8 @@ func (s *TestSuite) TestCancel(c *C) {
 
 	api := &ArvTestClient{ContainerRecord: rec}
 	cr := NewContainerRunner(api, &KeepTestClient{}, docker, "zzzzz-zzzzz-zzzzzzzzzzzzzzz")
+	am := &ArvMountCmdLine{}
+	cr.RunArvMount = am.ArvMountTest
 
 	go func() {
 		for cr.ContainerID == "" {
diff --git a/services/crunch-run/upload.go b/services/crunch-run/upload.go
index 23b7c38..a068a2a 100644
--- a/services/crunch-run/upload.go
+++ b/services/crunch-run/upload.go
@@ -103,7 +103,7 @@ func (m *CollectionFileWriter) goUpload() {
 	finish <- errors
 }
 
-// CollectionWriter makes implements creating new Keep collections by opening files
+// CollectionWriter implements creating new Keep collections by opening files
 // and writing to them.
 type CollectionWriter struct {
 	IKeepClient

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list