Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolv::DNS.new.getresource makes it hang forever #3568

Open
inossidabile opened this issue Dec 28, 2015 · 3 comments
Open

Resolv::DNS.new.getresource makes it hang forever #3568

inossidabile opened this issue Dec 28, 2015 · 3 comments

Comments

@inossidabile
Copy link

I'm running an Ubuntu Linux Server with the JRuby (tried all the versions above 9k). Right after the installation I couldn't install any gem. Debugging the rubygems code shown that this code hangs forever:

require 'resolv'
Resolv::DNS.new.getresource('_rubygems._tcp.rubygems.org', Resolv::DNS::Resource::IN::SRV)

I tried different Ubuntu versions (12-15) and different JRE (7-8 + Oracle version) without any difference. On the same machine it works on MRI. dig command also resolves everything properly. So it doesn't look like a network issue. The problem must be in Java or JRuby but I ran out of ideas how to debug it further.

I perfectly realize that it must be working for everyone else since googling didn't show anything up. But I don't think that hanging forever is a normal situation for any kind of misconfigured system (that I probably have) so it should be a bug also that only shows up in particular conditions.

@kares
Copy link
Member

kares commented Jan 14, 2016

quite a 🐛 ... on Ubuntu 15.10 and all seems well.
if you can could you obtain a thread-dump during the hang - maybe it would help narrow things down a bit.

@nbarrientos
Copy link
Contributor

I'm experiencing something similar:

irb(main):001:0> RUBY_PLATFORM
=> "java"
irb(main):002:0> JRUBY_VERSION
=> "1.7.20.1"
irb(main):003:0> require 'resolv'
=> true
irb(main):004:0> Resolv.getaddress "google.com"
JResolv::ResolvError: no address for google.com
        from /usr/share/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/1.9/resolv.rb:98:in `getaddress'
        from /usr/share/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/1.9/resolv.rb:48:in `getaddress'
        from (irb):4:in `evaluate'
        from org/jruby/RubyKernel.java:1111:in `eval'
        from org/jruby/RubyKernel.java:1511:in `loop'
        from org/jruby/RubyKernel.java:1274:in `catch'
        from org/jruby/RubyKernel.java:1274:in `catch'
        from /usr/share/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/bin/irb:17:in `(root)'
        from org/jruby/RubyKernel.java:1091:in `load'
        from -e:1:in `(root)'
        from jruby_puppet_core.clj:232:in `invoke'
        from jruby_puppet_core.clj:226:in `invoke'
        from jruby_puppet_core.clj:244:in `invoke'
        from jruby_puppet_core.clj:234:in `invoke'
        from irb.clj:7:in `invoke'
        from subcommand.clj:38:in `invoke'
        from irb.clj:11:in `doInvoke'
        from core.clj:624:in `invoke'
        from main.clj:315:in `invoke'
        from main.clj:420:in `doInvoke'irb(main):005:0>

It hangs for a very long time before it raises the exception.

OTOH, the system ruby on the same box works fine:

irb(main):001:0> RUBY_PLATFORM
=> "x86_64-linux"
irb(main):002:0> RUBY_VERSION
=> "2.0.0"
irb(main):003:0> require 'resolv'
=> true
irb(main):004:0> Resolv.getaddress "google.com"
=> "193.192.226.163"
irb(main):005:0>

JDK version: java-1.7.0-openjdk-1.7.0.95-2.6.4.0.el7_2.x86_64.
Running OS: CentOS Linux release 7.2.1511 (Core)

Resolv.conf only contains IPv6 servers. It might have nothing to do with this, though.

@nbarrientos
Copy link
Contributor

I opened a separate issue (#3663) at the end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants