[ARVADOS] updated: bc8a4a8863f147e4c0b95d0aa3e2f3e549637ee4

Git user git at public.curoverse.com
Wed Mar 22 15:58:23 EDT 2017


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

       via  bc8a4a8863f147e4c0b95d0aa3e2f3e549637ee4 (commit)
      from  a54e88868ac259443e2cd8d5f6fddb4b8154acb9 (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 bc8a4a8863f147e4c0b95d0aa3e2f3e549637ee4
Author: Lucas Di Pentima <lucas at curoverse.com>
Date:   Wed Mar 22 16:56:58 2017 -0300

    10218: Avoid running df commands more than necessary. Updated test to check for disk inodes report. Added deferred Close() call on CallRaw reader.

diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go
index e0d707a..26c8a7a 100644
--- a/services/crunch-run/crunchrun.go
+++ b/services/crunch-run/crunchrun.go
@@ -533,19 +533,11 @@ func (runner *ContainerRunner) LogNodeInfo() (err error) {
 		},
 		infoCommand{
 			label: "Disk Space",
-			cmd:   []string{"df", "-m", "/"},
-		},
-		infoCommand{
-			label: "Disk Space",
-			cmd:   []string{"df", "-m", os.TempDir()},
-		},
-		infoCommand{
-			label: "Disk INodes",
-			cmd:   []string{"df", "-i", "/"},
+			cmd:   []string{"df", "-m", "/", os.TempDir()},
 		},
 		infoCommand{
 			label: "Disk INodes",
-			cmd:   []string{"df", "-i", os.TempDir()},
+			cmd:   []string{"df", "-i", "/", os.TempDir()},
 		},
 	}
 
@@ -583,6 +575,7 @@ func (runner *ContainerRunner) LogContainerRecord() (err error) {
 	if err != nil {
 		return fmt.Errorf("While retrieving container record from the API server: %v", err)
 	}
+	defer reader.Close()
 	// Read the API server response as []byte
 	json_bytes, err := ioutil.ReadAll(reader)
 	if err != nil {
diff --git a/services/crunch-run/crunchrun_test.go b/services/crunch-run/crunchrun_test.go
index 9b12dd9..7224c4f 100644
--- a/services/crunch-run/crunchrun_test.go
+++ b/services/crunch-run/crunchrun_test.go
@@ -695,6 +695,7 @@ func (s *TestSuite) TestNodeInfoLog(c *C) {
 	c.Check(api.Logs["node-info"].String(), Matches, `(?ms).*CPU Information.*`)
 	c.Check(api.Logs["node-info"].String(), Matches, `(?ms).*Memory Information.*`)
 	c.Check(api.Logs["node-info"].String(), Matches, `(?ms).*Disk Space.*`)
+	c.Check(api.Logs["node-info"].String(), Matches, `(?ms).*Disk INodes.*`)
 }
 
 func (s *TestSuite) TestContainerRecordLog(c *C) {

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list