Jruby 1.3.0RC1 is broken for drb


#1

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:ininitialize’
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:inopen_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:inopen_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:instart_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

#2

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 S. 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

#3

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 N. 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

#4

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 N. 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

#5

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 N. 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

#6

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:inrecv_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:insend_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:inopen’
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:inwith_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 N. 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