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: AS15169 209.85.128.0/17 X-Spam-Status: No, score=-0.0 required=3.0 tests=AWL,BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: mogilefs-client-public@bogomips.org Received: from mail-ig0-f172.google.com (mail-ig0-f172.google.com [209.85.213.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 92C632060F for ; Wed, 2 Dec 2015 14:24:06 +0000 (UTC) Received: by igvg19 with SMTP id g19so118757181igv.1 for ; Wed, 02 Dec 2015 06:24:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=/NhyGxC50EOBzChcEOQtuFpNDyUo+FI7fSc01EqJveU=; b=BU24gi75U9gF0lohPczmdYbQmrzn8Z7OiCGhjTpobcxpFYd3WKs4tW1otmr1NOtpFV ouhLkA25jTT0fpKzwuxfzd6DN7XouOmWuS3uKu7JcajcDzrOIKFyIoBv+V/z1ao9J5vD teP0g573DlDjhmDcYAeDRUfNeqDWJqBooa6c/vMytZA8CANiQb+TqeatT+M6UKilD3UK j8pahqrHagkFZ2YR2aOyIAh6NZNVrx6Ve1VzkBVUhNqex3nmttUEmSkHV2iWMo4ypHpZ aqqzRgwUKoLelIqDQYlFEyj8OwXLAIXSPl4l+rnrVMLc45Gt5omB8sCGtv6kf8o6z/zw gPQw== MIME-Version: 1.0 X-Received: by 10.50.150.71 with SMTP id ug7mr3851185igb.68.1449066245915; Wed, 02 Dec 2015 06:24:05 -0800 (PST) Received: by 10.36.65.203 with HTTP; Wed, 2 Dec 2015 06:24:05 -0800 (PST) Date: Wed, 2 Dec 2015 23:24:05 +0900 Message-ID: Subject: JRuby 9.0.4.0 + mogilefs-client From: =?UTF-8?B?5LyK6Jek5rSL5Lmf?= To: mogilefs-client-public@bogomips.org Content-Type: text/plain; charset=UTF-8 List-Id: 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 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 # 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 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 ----------------------------------------------