about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-01-30 20:17:29 +0000
committerEric Wong <e@80x24.org>2017-01-30 20:17:29 +0000
commita251cba43a0c24a7aa04b1baf3421ba6f7bf6cda (patch)
treef3eb7c0ff590014cf4df2bcf33e751d6b9497a0d
parent42402dbe14f54220ffd208e935b33c997feacd24 (diff)
downloadmogilefs-client-a251cba43a0c24a7aa04b1baf3421ba6f7bf6cda.tar.gz
socket_common: limit IO#write garbage workaround to <= 2.4
It looks like this regression will be fixed in time for
Ruby 2.5.
-rw-r--r--lib/mogilefs/socket_common.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/mogilefs/socket_common.rb b/lib/mogilefs/socket_common.rb
index 9383731..d430068 100644
--- a/lib/mogilefs/socket_common.rb
+++ b/lib/mogilefs/socket_common.rb
@@ -57,12 +57,11 @@ module MogileFS::SocketCommon
     timed_read(size, buf, timeout) or raise EOFError, "end of file reached"
   end
 
-  # workaround for https://bugs.ruby-lang.org/issues/13085
+  # Workaround for https://bugs.ruby-lang.org/issues/13085
   # (excessive garbage from IO#write)
-  # XXX maybe this can be fixed for Ruby 2.5 final, but maybe not:
-  # Update this when Ruby 2.5 is released on 2017-12-25
+  # This looks like it will be fixed in Ruby 2.5 final.
   if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ruby' &&
-     RUBY_VERSION.to_f >= 2.2 && RUBY_VERSION.to_f <= 2.5
+     RUBY_VERSION.to_f >= 2.2 && RUBY_VERSION.to_f <= 2.4
     def write(buf)
       # Blocking TCP writes would error out long before one day,
       # and MogileFS won't allow file creations which take over a day.