Ruby mogilefs-client dev/users discussion/patches/bugs/help/...
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: 伊藤洋也 <hiroyan@gmail.com>
Cc: mogilefs-client-public@bogomips.org
Subject: Re: JRuby 9.0.4.0 + mogilefs-client
Date: Wed, 2 Dec 2015 20:53:43 +0000	[thread overview]
Message-ID: <20151202205343.GA5690@dcvr.yhbt.net> (raw)
In-Reply-To: <CAHQkfaqcjVdjXATmyOz_yNRDgCdOJUN3pUWMURhd3zpBCNYLdw@mail.gmail.com>

伊藤洋也 <hiroyan@gmail.com> 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.

  reply	other threads:[~2015-12-02 20:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-02 14:24 JRuby 9.0.4.0 + mogilefs-client 伊藤洋也
2015-12-02 20:53 ` Eric Wong [this message]
2016-08-31  2:30   ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/mogilefs-client/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151202205343.GA5690@dcvr.yhbt.net \
    --to=e@80x24.org \
    --cc=hiroyan@gmail.com \
    --cc=mogilefs-client-public@bogomips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/mogilefs-client.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).