From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, BODY_8BITS,URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: mogilefs-client-public@bogomips.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id AE6882060F; Wed, 2 Dec 2015 20:52:40 +0000 (UTC) Date: Wed, 2 Dec 2015 20:53:43 +0000 From: Eric Wong To: =?utf-8?B?5LyK6Jek5rSL5Lmf?= Cc: mogilefs-client-public@bogomips.org Subject: Re: JRuby 9.0.4.0 + mogilefs-client Message-ID: <20151202205343.GA5690@dcvr.yhbt.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: 伊藤洋也 wrote: > The same problem has been issued and discussed on GitHub jruby/jruby > https://github.com/jruby/jruby/issues/1694, but not been resolved yet. > > It might not be appropriate to ask you about this problem since it > does not seem to be the problem of mogilfs-client but of jruby, but do > you have any ideas? I can help with nearly any userspace <-> kernel issues on GNU/Linux and maybe FreeBSD. However, I don't know C++ or Java at all, so I'm not sure what your JVM or JRuby is doing... Under Linux, it would be helpful to compare strace output between C Ruby and JRuby with the test script below (and variations from making adjustments where I left "XXX" comments). Does retrying connect_nonblock on EINPROGRESS/EALREADY help? In other words, something like this: require 'socket' require 'io/wait' sock = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0) addr = Socket.sockaddr_in(7001, '127.0.0.1') begin # XXX it would be worth trying sock.connect(addr) instead # and compare strace output between C Ruby and JRuby, too sock.connect_nonblock(addr) rescue Errno::EINPROGRESS, Errno::EALREADY => e warn "waiting on #{e.class}" # XXX Maybe you need to comment out this line on JRuby? # Ideally you wouldn't need the timeout arg for wait_writable sock.wait_writable(0.001) retry rescue Errno::EISCONN warn "Success!" end unless sock.wait_writable(5) raise 'MogileFS::Timeout, socket connect timeout' end ---------------- And based on the comments on that ticket, it might be a problem with the JVM or JRuby mishandling the issue... Regardless of whether I can help, thank you for documenting the issue publically.