Forum: JRuby jruby 1.3.0RC1 is broken for drb

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
19d0e6c6acf1337e1855dc1468ba1c89?d=identicon&s=25 Manish Sapariya (manishsapariya)
on 2009-05-15 10:42
(Received via mailing list)
Hi,
Is this known issue? Is there work around?

[manish@alioth rubyexperiments]$ jruby server.rb
/opt/jruby/lib/ruby/1.8/drb/drb.rb:968:in `set_sockopt': JRuby only
supports F_SETFL for fcntl/ioctl currently (NotImplementedError)
         from /opt/jruby/lib/ruby/1.8/drb/drb.rb:890:in `initialize'
         from /opt/jruby/lib/ruby/1.8/drb/drb.rb:869:in `open_server'
         from /opt/jruby/lib/ruby/1.8/drb/drb.rb:759:in `open_server'
         from /opt/jruby/lib/ruby/1.8/drb/drb.rb:757:in `each'
         from /opt/jruby/lib/ruby/1.8/drb/drb.rb:757:in `open_server'
         from /opt/jruby/lib/ruby/1.8/drb/drb.rb:1344:in `initialize'
         from /opt/jruby/lib/ruby/1.8/drb/drb.rb:1620:in `start_service'
         from server.rb:30
[manish@alioth rubyexperiments]$ jruby -v
jruby 1.3.0RC1 (ruby 1.8.6p287) (2009-05-01 9cbadb8) (IcedTea Client VM
1.7.0) [i386-java]
[manish@alioth rubyexperiments]$

This works on on jRuby-1.2-RC1.


Thanks and Regards,
Manish

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Ede2aa10c6462f1d825143879be59e38?d=identicon&s=25 Charles Oliver Nutter (Guest)
on 2009-05-15 22:51
(Received via mailing list)
Ahh this is unfortunate. We do not support all Fcntl flags, but because
we now *define* all the flags drb is trying to use them. In this case
it's FD_CLOEXEC.

So please do file a bug, and then we have two options:

1. Modify DRB to not use this flag. It would be a direct modification to
stdlib, but I'd be ok with it.
2. Implement this flag for our IO objects. I don't know what it does or
if it would be easy to support.

Fcntl will probably be an ongoing thorn since we can only emulate it.

We need to address this for 1.3...blocker since drb doesn't work.

Manish Sapariya wrote:
>         from /opt/jruby/lib/ruby/1.8/drb/drb.rb:757:in `open_server'
>
> Thanks and Regards,
> Manish
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Ede2aa10c6462f1d825143879be59e38?d=identicon&s=25 Charles Oliver Nutter (Guest)
on 2009-05-15 22:53
(Received via mailing list)
This is similar to the issue that came up in OpenSSL recently; because
we started defining F_GETFL ssl.rb started trying to use it.

I'm leaning toward starting to diverge a bit and removing some of these
calls from our copy of the stdlib that we know will never quite work
right, rather than bending over backward to emulate them...

Charles Oliver Nutter wrote:
>
>> supports F_SETFL for fcntl/ioctl currently (NotImplementedError)
>> VM 1.7.0) [i386-java]
>>
>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Ede2aa10c6462f1d825143879be59e38?d=identicon&s=25 Charles Oliver Nutter (Guest)
on 2009-05-16 00:07
(Received via mailing list)
It looks like CLOEXEC is just to close FDs on exec(2), which we don't
really support, so ignoring CLOEXEC is probably the right way to go.
Tom's making that fix now, and I modified Fcntl to have the appropriate
constants it was missing.

I suppose this underscores that we should be running more stdlib tests.
Anyone want to start modifying our build to run them? Patches greatly
appreciated.

Charles Oliver Nutter wrote:
>> this case it's FD_CLOEXEC.
>> We need to address this for 1.3...blocker since drb doesn't work.
>>>         from /opt/jruby/lib/ruby/1.8/drb/drb.rb:759:in `open_server'
>>> This works on on jRuby-1.2-RC1.
>>>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Ede2aa10c6462f1d825143879be59e38?d=identicon&s=25 Charles Oliver Nutter (Guest)
on 2009-05-16 00:42
(Received via mailing list)
Tom just committed the change...if you still file a bug, please let us
know what bug number and we'll add information about the commit. But it
should work on master now.

Charles Oliver Nutter wrote:
>> This is similar to the issue that came up in OpenSSL recently; because
>>>
>>>
>>>>         from /opt/jruby/lib/ruby/1.8/drb/drb.rb:757:in `each'
>>>>
>>>
>> To unsubscribe from this list, please visit:
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
19d0e6c6acf1337e1855dc1468ba1c89?d=identicon&s=25 Manish Sapariya (manishsapariya)
on 2009-05-18 07:53
(Received via mailing list)
Thanks for the fix Charles, it works.
The reason I am trying out 1.3-rc1/trunk is because of this problem.

I looked at the Jira and Googled it. I could not find any issues which
talks about this or similar issue. My little debugging using wireshark
shows that server is closing connection while yielding to client, no
exception or error on server side.

=============
/opt/jruby/lib/ruby/1.8/drb/drb.rb:570:in `load': connection closed
(DRb::DRbConnError)
         from /opt/jruby/lib/ruby/1.8/drb/drb.rb:632:in `recv_reply'
         from /opt/jruby/lib/ruby/1.8/drb/drb.rb:922:in `recv_reply'
         from /opt/jruby/lib/ruby/1.8/drb/drb.rb:1200:in `send_message'
         from /opt/jruby/lib/ruby/1.8/drb/drb.rb:1091:in
`method_missing'
         from /opt/jruby/lib/ruby/1.8/drb/drb.rb:1175:in `open'
         from /opt/jruby/lib/ruby/1.8/drb/drb.rb:1090:in
`method_missing'
         from /opt/jruby/lib/ruby/1.8/drb/drb.rb:1108:in `with_friend'
         from /opt/jruby/lib/ruby/1.8/drb/drb.rb:1089:in
`method_missing'
         from simpleclient.rb:5
================

Here is my simple server
=============
require 'drb/drb'

module DCP
    class Site
      include DRbUndumped
                 def test()
                         yield
                 end
    end
end

if __FILE__ == $0
    DRb.start_service("druby://localhost:7654", DCP::Site.new)
    puts DRb.uri
    DRb.thread.join
end
=============

======And client=======
require 'drb/drb'

DRb.start_service
there = DRbObject.new_with_uri('druby://localhost:7654')
there.test() {
         puts "This is what was expected"
}
=======================

Any ideas? Shall I create ticket?

Thanks and Regards,
Manish

Charles Oliver Nutter wrote:
>> I suppose this underscores that we should be running more stdlib
>>>
>>>> or if it would be easy to support.
>>>>> /opt/jruby/lib/ruby/1.8/drb/drb.rb:968:in `set_sockopt': JRuby only
>>>>> [manish@alioth rubyexperiments]$ jruby -v
>>>>> ---------------------------------------------------------------------
>>>>    http://xircles.codehaus.org/manage_email
>>
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
This topic is locked and can not be replied to.