[ARVADOS] updated: de79b73c55c5b1c469766ac8f930f335ac3fc246

git at public.curoverse.com git at public.curoverse.com
Tue Oct 21 13:46:06 EDT 2014


Summary of changes:
 services/api/script/crunch-dispatch.rb | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

       via  de79b73c55c5b1c469766ac8f930f335ac3fc246 (commit)
      from  6d3a88841b58eb02f6f6aedd38a40ed02cc42d1f (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 de79b73c55c5b1c469766ac8f930f335ac3fc246
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Oct 21 13:46:00 2014 -0400

    4266: Tweak long-line handling.

diff --git a/services/api/script/crunch-dispatch.rb b/services/api/script/crunch-dispatch.rb
index bbb2be9..94311ed 100755
--- a/services/api/script/crunch-dispatch.rb
+++ b/services/api/script/crunch-dispatch.rb
@@ -450,14 +450,20 @@ class Dispatcher
         bufend = ''
         streambuf.lines("\n").each do |line|
           if not line.end_with? "\n"
-            if line.size > 2**20
+            if line.size > Rails.configuration.crunch_log_throttle_bytes
               # Without a limit here, we'll use 2x an arbitrary amount
               # of memory, and waste a lot of time copying strings
               # around, all without providing any feedback to anyone
               # about what's going on _or_ hitting any of our throttle
-              # limits. Better to introduce a spurious line break once
-              # in a while:
-              line << "[...]\n"
+              # limits.
+              #
+              # Here we leave "line" alone, knowing it will never be
+              # sent anywhere: rate_limit() will reach
+              # crunch_log_throttle_bytes immediately. However, we'll
+              # leave [...] in bufend: if the trailing end of the long
+              # line does end up getting sent anywhere, it will have
+              # some indication that it incomplete.
+              bufend = "[...]"
             else
               # If line length is sane, we'll wait for the rest of the
               # line to appear in the next read_pipes() call.

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list