From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 34E3C20D11 for ; Mon, 30 Jan 2017 20:20:34 +0000 (UTC) From: Eric Wong To: mogilefs-client-public@bogomips.org Subject: [PATCH] socket_common: limit IO#write garbage workaround to <= 2.4 Date: Mon, 30 Jan 2017 20:20:34 +0000 Message-Id: <20170130202034.29242-1-e@80x24.org> List-Id: It looks like this regression will be fixed in time for Ruby 2.5. --- lib/mogilefs/socket_common.rb | 7 +++---- 1 file 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 @@ def readpartial(size, buf = "", timeout = 5) 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. -- EW