[ARVADOS] updated: 97369f522bfc9018b201f5988cd187af324c6544

git at public.curoverse.com git at public.curoverse.com
Sun Feb 7 17:37:31 EST 2016


Summary of changes:
 tools/crunchstat-summary/crunchstat_summary/summarizer.py | 7 +++++++
 1 file changed, 7 insertions(+)

       via  97369f522bfc9018b201f5988cd187af324c6544 (commit)
      from  2f0a0ba4ce7da315f94c2d4a9bfb27a835940618 (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 97369f522bfc9018b201f5988cd187af324c6544
Author: Tom Clegg <tom at curoverse.com>
Date:   Sun Feb 7 17:37:26 2016 -0500

    8341: Stop fetching logs at the last page, even if new pages keep appearing.

diff --git a/tools/crunchstat-summary/crunchstat_summary/summarizer.py b/tools/crunchstat-summary/crunchstat_summary/summarizer.py
index 80317f6..25562e8 100644
--- a/tools/crunchstat-summary/crunchstat_summary/summarizer.py
+++ b/tools/crunchstat-summary/crunchstat_summary/summarizer.py
@@ -350,6 +350,7 @@ class LiveLogReader(object):
             ['event_type', '=', 'stderr']]
         self._last_id = 0
         self._buffer = collections.deque()
+        self._got_all = False
 
     def __iter__(self):
         return self
@@ -358,6 +359,8 @@ class LiveLogReader(object):
         if self._buffer is None:
             raise StopIteration
         elif len(self._buffer) == 0:
+            if self._got_all:
+                raise StopIteration
             got = arvados.api().logs().index(
                 limit=1000,
                 order=['id asc'],
@@ -365,8 +368,12 @@ class LiveLogReader(object):
             ).execute()
             logger.debug('received %d, %d more remain', len(got['items']), got['items_available'] - len(got['items']))
             if len(got['items']) == 0:
+                self._got_all = True
                 self._buffer = None
                 raise StopIteration
+            elif len(got['items']) == got['items_available']:
+                # Don't try to fetch any more after this page
+                self._got_all = True
             for i in got['items']:
                 for line in i['properties']['text'].split('\n'):
                     self._buffer.append(line) 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list