Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.0.1
    • Fix Version/s: JRuby 1.1.5
    • Component/s: Core Classes/Modules
    • Labels:
      None
    • Environment:
      Running Jruby 1.0.1 on Ubuntu Gutsy Gibbon (7.10), kernel 2.6.22-13-generic
    • Number of attachments :
      1

      Description

      When running:

      require 'rinda/ring'
      DRb.start_service
      ring_server = Rinda::RingFinger.primary

      the last call causes jruby to hang on line 181 of rinda/ring.rb:

      soc = UDPSocket.open

      The test code is from the list_services.rb example at http://segment7.net/projects/ruby/drb/rinda/ringserver.html.

      May be related to the rudimentary UDP support mentioned in issue JRUBY-1126.

        Activity

        Hide
        Joe Mooney added a comment - - edited

        http://segment7.net/projects/ruby/drb/rinda/ringserver.html

        Three little scripts, start the first two and then the third
        The third fails on Rinda::RingFinger.primary
        Note: that if one or other of these is run with ruby MRI you get somewhat better results. All three together run fine in MRI.

        #!/usr/bin/env ruby -w
        # rinda_ts.rb
        # Registering a TupleSpace with Rinda::Ring
        
        require 'rinda/ring'
        require 'rinda/tuplespace'
        
        DRb.start_service
        
        ts = Rinda::TupleSpace.new
        
        provider = Rinda::RingProvider.new :TupleSpace, ts, 'Tuple Space'
        provider.provide
        
        DRb.thread.join
        
        #!/usr/bin/env ruby -w
        # ringserver.rb
        # Rinda RingServer
        
        require 'rinda/ring'
        require 'rinda/tuplespace'
        
        # start DRb
        DRb.start_service
        
        # Create a TupleSpace to hold named services, and start running
        Rinda::RingServer.new Rinda::TupleSpace.new
        
        # Wait until the user explicitly kills the server.
        DRb.thread.join
        
        #!/usr/bin/env ruby -w
        # list_services.rb
        # List all of the services the RingServer knows about
        
        require 'rinda/ring'
        
        DRb.start_service
        
        ring_server = Rinda::RingFinger.primary
        services = ring_server.read_all [:name, nil, nil, nil]
        
        puts "Services on #{ring_server.__drburi}"
        services.each do |service|
          puts "#{service[1]} on #{service[2].__drburi} - #{service[3]}"
        end
        
        Show
        Joe Mooney added a comment - - edited http://segment7.net/projects/ruby/drb/rinda/ringserver.html Three little scripts, start the first two and then the third The third fails on Rinda::RingFinger.primary Note: that if one or other of these is run with ruby MRI you get somewhat better results. All three together run fine in MRI. #!/usr/bin/env ruby -w # rinda_ts.rb # Registering a TupleSpace with Rinda::Ring require 'rinda/ring' require 'rinda/tuplespace' DRb.start_service ts = Rinda::TupleSpace.new provider = Rinda::RingProvider.new :TupleSpace, ts, 'Tuple Space' provider.provide DRb.thread.join #!/usr/bin/env ruby -w # ringserver.rb # Rinda RingServer require 'rinda/ring' require 'rinda/tuplespace' # start DRb DRb.start_service # Create a TupleSpace to hold named services, and start running Rinda::RingServer.new Rinda::TupleSpace.new # Wait until the user explicitly kills the server. DRb.thread.join #!/usr/bin/env ruby -w # list_services.rb # List all of the services the RingServer knows about require 'rinda/ring' DRb.start_service ring_server = Rinda::RingFinger.primary services = ring_server.read_all [:name, nil, nil, nil] puts "Services on #{ring_server.__drburi}" services.each do |service| puts "#{service[1]} on #{service[2].__drburi} - #{service[3]}" end
        Hide
        Charles Oliver Nutter added a comment -

        Unfortunately this won't make 1.0.2.

        Show
        Charles Oliver Nutter added a comment - Unfortunately this won't make 1.0.2.
        Hide
        mike houghton added a comment -

        Using ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] the script below works

        require "rinda/tuplespace"
        require "rinda/ring"
        
        
        include Rinda
        DRb.start_service
        
        ts = TupleSpace.new
        ring = RingServer.new(ts)
        puts "started #{ring}  #{ts}"
        DRb.thread.join
        

        Using jruby 1.0.1 the following error occurs.

        C:/jruby-1.0.1/lib/ruby/1.8/rinda/ring.rb:34:in `initialize': uninitialized constant Rinda::RingServer::UDPSocket (NameError)
        from :1:in `new'
        from :1

        Show
        mike houghton added a comment - Using ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] the script below works require "rinda/tuplespace" require "rinda/ring" include Rinda DRb.start_service ts = TupleSpace.new ring = RingServer.new(ts) puts "started #{ring} #{ts}" DRb.thread.join Using jruby 1.0.1 the following error occurs. C:/jruby-1.0.1/lib/ruby/1.8/rinda/ring.rb:34:in `initialize': uninitialized constant Rinda::RingServer::UDPSocket (NameError) from :1:in `new' from :1
        Hide
        Charles Oliver Nutter added a comment -

        See if this is still a problem in 1.1 branch. 1.0 branch is dead.

        Show
        Charles Oliver Nutter added a comment - See if this is still a problem in 1.1 branch. 1.0 branch is dead.
        Hide
        Charles Oliver Nutter added a comment -

        The scripts appear to work fine under JRuby 1.1.5, although there is a very long delay in listing the services. That delay appears to be unrelated to the original issue, however (Inet6 lookup timeout) and I'll file a separate bug for it.

        Show
        Charles Oliver Nutter added a comment - The scripts appear to work fine under JRuby 1.1.5, although there is a very long delay in listing the services. That delay appears to be unrelated to the original issue, however (Inet6 lookup timeout) and I'll file a separate bug for it.

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Menno Jonkers
          • Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: