From: 伊藤洋也 <hiroyan@gmail.com>
To: mogilefs-client-public@bogomips.org
Subject: JRuby 9.0.4.0 + mogilefs-client
Date: Wed, 2 Dec 2015 23:24:05 +0900 [thread overview]
Message-ID: <CAHQkfaqcjVdjXATmyOz_yNRDgCdOJUN3pUWMURhd3zpBCNYLdw@mail.gmail.com> (raw)
Hello.
I have implmemted S3 like API with mogilefs-client + Rails + CRuby,
and it works very well.
When I tried to run mogilefs-client with jruby experimentally, an
following exception was raised.
* mogilefs-test.rb
```
#!/usr/bin/env ruby
require 'mogilefs'
mogfs = MogileFS::MogileFS.new(
hosts: ['127.0.0.1:7001'],
domain: 'sandbox',
)
mogfs.sleep(1)
puts "ok"
```
````
$ uname -a
Linux vagrant-centos6 2.6.32-573.el6.x86_64 #1 SMP Thu Jul 23 15:44:03
UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
$ ruby -v
jruby 9.0.4.0 (2.2.2) 2015-11-12 b9fb7aa OpenJDK 64-Bit Server VM
25.65-b01 on 1.8.0_65-b17 +jit [linux-amd64]
$ $ echo '!version' | nc localhost 7001
2.72
.
$ ruby mogilefs-test.rb
MogileFS::UnreachableBackendError: couldn't connect to any tracker:
127.0.0.1:7001 - socket connect timeout (MogileFS::Timeout)
socket at
/usr/local/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/mogilefs-client-3.9.0/lib/mogilefs/backend.rb:362
dispatch_unlocked at
/usr/local/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/mogilefs-client-3.9.0/lib/mogilefs/backend.rb:143
block in do_request at
/usr/local/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/mogilefs-client-3.9.0/lib/mogilefs/backend.rb:243
synchronize at org/jruby/ext/thread/Mutex.java:151
do_request at
/usr/local/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/mogilefs-client-3.9.0/lib/mogilefs/backend.rb:241
block in get_paths at
/usr/local/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/mogilefs-client-3.9.0/lib/mogilefs/backend.rb:23
get_paths at
/usr/local/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/mogilefs-client-3.9.0/lib/mogilefs/mogilefs.rb:222
<top> at mogilefs-test.rb:10
# I have also tested on OSX
# Darwin PMAC132S.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul
29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64 i386
MacBookPro11,1 Darwin
#
# $ ruby -v
# jruby 9.0.4.0 (2.2.2) 2015-11-12 b9fb7aa Java HotSpot(TM) 64-Bit
Server VM 25.60-b23 on 1.8.0_60-b27 +jit [darwin-x86_64]
#
# MogileFS::UnreachableBackendError: couldn't connect to any tracker:
127.0.0.1:7001 - socket connect timeout (MogileFS::Timeout)
# socket at
/Users/hiroya/.rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/mogilefs-client-3.9.0/lib/mogilefs/backend.rb:362
# dispatch_unlocked at
/Users/hiroya/.rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/mogilefs-client-3.9.0/lib/mogilefs/backend.rb:143
# block in do_request at
/Users/hiroya/.rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/mogilefs-client-3.9.0/lib/mogilefs/backend.rb:243
# synchronize at org/jruby/ext/thread/Mutex.java:151
# do_request at
/Users/hiroya/.rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/mogilefs-client-3.9.0/lib/mogilefs/backend.rb:241
# block in get_paths at
/Users/hiroya/.rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/mogilefs-client-3.9.0/lib/mogilefs/backend.rb:23
# get_paths at
/Users/hiroya/.rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/mogilefs-client-3.9.0/lib/mogilefs/mogilefs.rb:222
# <top> at mogilefs-test.rb:9
#
````
When I use CRuby, it works properly.
```
$ ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
$ ruby mogilefs-test.rb
ok
```
And I investigated the execpetion and the same exception was
reproduced by following code.
* socket-test.rb
```
#!/usr/bin/env ruby
require 'socket'
require 'io/wait'
sock = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
begin
sock.connect_nonblock(Socket.sockaddr_in(7001, '127.0.0.1'))
sock.post_init(host, port)
rescue Errno::EINPROGRESS
end
unless sock.wait_writable(5)
raise 'MogileFS::Timeout, socket connect timeout'
end
```
```
$ ruby socket-test.rb
RuntimeError: MogileFS::Timeout, socket connect timeout
<top> at socket-test.rb:15
```
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?
Regards.
----------------------------------------------
Hiroya Ito
* hiroyan@gmail.com
* https://github.com/hiboma/
* GMO Pepabo, Inc https://pepabo.com
----------------------------------------------
next reply other threads:[~2015-12-02 14:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-02 14:24 伊藤洋也 [this message]
2015-12-02 20:53 ` JRuby 9.0.4.0 + mogilefs-client Eric Wong
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=CAHQkfaqcjVdjXATmyOz_yNRDgCdOJUN3pUWMURhd3zpBCNYLdw@mail.gmail.com \
--to=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).