[ARVADOS] updated: 20fe67d073424f5c277fbd13557ffe5ae2b15fd9

git at public.curoverse.com git at public.curoverse.com
Wed Jan 13 10:18:40 EST 2016


Summary of changes:
 services/crunchstat/crunchstat.go                            | 4 ++--
 tools/crunchstat-summary/crunchstat_summary/summarizer.py    | 6 +++++-
 tools/crunchstat-summary/tests/crunchstat_error_messages.txt | 6 ++++++
 tools/crunchstat-summary/tests/test_examples.py              | 7 +++++++
 4 files changed, 20 insertions(+), 3 deletions(-)
 create mode 100644 tools/crunchstat-summary/tests/crunchstat_error_messages.txt

       via  20fe67d073424f5c277fbd13557ffe5ae2b15fd9 (commit)
      from  0343fe988fdc50bdfb1ac34204c1a4998fc7c446 (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 20fe67d073424f5c277fbd13557ffe5ae2b15fd9
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Jan 13 10:18:17 2016 -0500

    8123: Fix crunchstat formatting error and resulting crunchstat-summary crash.

diff --git a/services/crunchstat/crunchstat.go b/services/crunchstat/crunchstat.go
index e149124..6bce325 100644
--- a/services/crunchstat/crunchstat.go
+++ b/services/crunchstat/crunchstat.go
@@ -142,7 +142,7 @@ func GetContainerNetStats(cgroup Cgroup) (io.Reader, error) {
 		statsFilename := fmt.Sprintf("/proc/%s/net/dev", taskPid)
 		stats, err := ioutil.ReadFile(statsFilename)
 		if err != nil {
-			statLog.Printf("read %s: %s\n", statsFilename, err)
+			statLog.Printf("error reading %s: %s\n", statsFilename, err)
 			continue
 		}
 		return strings.NewReader(string(stats)), nil
@@ -409,7 +409,7 @@ func run(logger *log.Logger) error {
 			if cmd.Process != nil {
 				cmd.Process.Signal(catch)
 			}
-			statLog.Println("caught signal:", catch)
+			statLog.Println("notice: caught signal:", catch)
 		}(sigChan)
 		signal.Notify(sigChan, syscall.SIGTERM)
 		signal.Notify(sigChan, syscall.SIGINT)
diff --git a/tools/crunchstat-summary/crunchstat_summary/summarizer.py b/tools/crunchstat-summary/crunchstat_summary/summarizer.py
index ccee1e2..f648e9b 100644
--- a/tools/crunchstat-summary/crunchstat_summary/summarizer.py
+++ b/tools/crunchstat-summary/crunchstat_summary/summarizer.py
@@ -93,10 +93,14 @@ class Summarizer(object):
                 self.label = m.group('job_uuid')
                 logger.debug('%s: using job uuid as label', self.label)
             if m.group('category').endswith(':'):
-                # "notice:" etc.
+                # "stderr crunchstat: notice: ..."
                 continue
             elif m.group('category') == 'error':
                 continue
+            elif m.group('category') == 'read':
+                # "stderr crunchstat: read /proc/1234/net/dev: ..."
+                # (crunchstat formatting fixed, but old logs still say this)
+                continue
             task_id = self.seq_to_uuid[int(m.group('seq'))]
             task = self.tasks[task_id]
 
diff --git a/tools/crunchstat-summary/tests/crunchstat_error_messages.txt b/tools/crunchstat-summary/tests/crunchstat_error_messages.txt
new file mode 100644
index 0000000..131e985
--- /dev/null
+++ b/tools/crunchstat-summary/tests/crunchstat_error_messages.txt
@@ -0,0 +1,6 @@
+2016-01-07_00:15:33 tb05z-8i9sb-khsk5rmf4xjdcbl 20819 0 stderr 
+2016-01-07_00:15:33 tb05z-8i9sb-khsk5rmf4xjdcbl 20819 0 stderr old error message:
+2016-01-07_00:15:33 tb05z-8i9sb-khsk5rmf4xjdcbl 20819 0 stderr crunchstat: read /proc/3305/net/dev: open /proc/3305/net/dev: no such file or directory
+2016-01-07_00:15:34 tb05z-8i9sb-khsk5rmf4xjdcbl 20819 0 stderr 
+2016-01-07_00:15:34 tb05z-8i9sb-khsk5rmf4xjdcbl 20819 0 stderr new error message:
+2016-01-07_00:15:34 tb05z-8i9sb-khsk5rmf4xjdcbl 20819 0 stderr crunchstat: error reading /proc/3305/net/dev: open /proc/3305/net/dev: no such file or directory
diff --git a/tools/crunchstat-summary/tests/test_examples.py b/tools/crunchstat-summary/tests/test_examples.py
index d35e81e..4fe7b27 100644
--- a/tools/crunchstat-summary/tests/test_examples.py
+++ b/tools/crunchstat-summary/tests/test_examples.py
@@ -34,6 +34,13 @@ class SummarizeFile(ReportDiff):
             self.diff_known_report(logfile, cmd)
 
 
+class SummarizeEdgeCases(unittest.TestCase):
+    def test_error_messages(self):
+        logfile = open(os.path.join(TESTS_DIR, 'crunchstat_error_messages.txt'))
+        s = crunchstat_summary.summarizer.Summarizer(logfile)
+        s.run()
+
+
 class SummarizeJob(ReportDiff):
     fake_job_uuid = '4xphq-8i9sb-jq0ekny1xou3zoh'
     fake_log_id = 'fake-log-collection-id'

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list