DRb from MRI server to JRuby client fails with long messages
------------------------------------------------------------
Key: JRUBY-2307
URL: http://jira.codehaus.org/browse/JRUBY-2307
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.1RC2
Environment: Mac OS X 10.4, JRuby 1.1RC2, Ruby 1.8.6
Reporter: Sean Carr
DRb Server
{code}
require 'drb'
class TestServer
def get_string(size)
"1" * size
end
end
server = TestServer.new
DRb.start_service('druby://localhost:12345', server)
DRb.thread.join
{code}
DRb Client
{code}
require 'drb'
obj = DRbObject.new(nil, 'druby://localhost:12345')
[1007, 1008].each do |n|
begin
obj.get_string(n)
puts "Worked with size #{n}"
rescue Exception => e
puts "Exception with size #{n}: #{e.inspect}"
end
end
{code}
|| || || SERVER || |
|| | | MRI | JRuby |
|| CLIENT | MRI | works | works |
|| | JRuby | breaks at 1008 | works |
Both 1007 and 1008 work fine in unless the server is running in MRI and the
client is running in JRuby. In that case, sending a string of 1008 characters
causes this exception on the JRuby client:
DRb::DRbConnError: premature marshal format(can't read)
from /usr/local/jruby/lib/ruby/1.8/drb/drb.rb:580:in `load'
from /usr/local/jruby/lib/ruby/1.8/drb/drb.rb:633:in `recv_reply'
from /usr/local/jruby/lib/ruby/1.8/drb/drb.rb:921:in `recv_reply'
from /usr/local/jruby/lib/ruby/1.8/drb/drb.rb:1195:in `send_message'
from /usr/local/jruby/lib/ruby/1.8/drb/drb.rb:1086:in `method_missing'
from /usr/local/jruby/lib/ruby/1.8/drb/drb.rb:1085:in `open'
from /usr/local/jruby/lib/ruby/1.8/drb/drb.rb:1159:in `method_missing'
from /usr/local/jruby/lib/ruby/1.8/drb/drb.rb:1085:in `with_friend'
from /usr/local/jruby/lib/ruby/1.8/drb/drb.rb:1084:in `method_missing'
from /usr/local/jruby/lib/ruby/1.8/drb/drb.rb:1085:in `puts'
This example is much simplified from my original problem which involved sending
other objects. It seems that the problem is related to the size of the
marshalled data, not what the data is. One thing to note though is that
occasionally sending 1008 characters will work just fine. This is a small
percentage of the time but it does happen.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email