Resolv::DNS..getresource produces different errors then MRI #4104

Closed
mkristian opened this Issue Aug 23, 2016 · 2 comments

Projects

None yet

4 participants

@mkristian
Member

Environment

Provide at least:

  • jruby-7.1.25 and jruby-9.1.2.0
  • macos

Expected Behavior

  • local rubygems repo server.
  • no internet connection
  • gem install nexus fails. jruby-9.1.2.0 gives an IOError and jruby-1.7.25 an SockerError. the respective code in rubygems looks like
begin
      res = @dns.getresource "_rubygems._tcp.#{host}",
                             Resolv::DNS::Resource::IN::SRV
    rescue Resolv::ResolvError
      uri
    else
      target = res.target.to_s.strip

      if /\.#{Regexp.quote(host)}\z/ =~ target
        return URI.parse "#{uri.scheme}://#{target}#{uri.path}"
      end

      uri
    end

where host is localhost and @dns = Resolv::DNS.new. I am not sure what the idea of the reverse lookup but jruby clearly throws different errors then MRI.

Actual Behavior

  • gem install nexus works on local repository server without further internet

the sonatype nexus server is a caching proxy and can cache rubygems repositories. one feature is that it can serve everything locally cached even with cut internet.

@headius
Member
headius commented Aug 24, 2016

@etehtsea has improvements and I have a socket branch that may handle this better.

@etehtsea
Contributor
etehtsea commented Nov 22, 2016 edited

I have a fix for this issue. Will open PR soon.

UPD: #4329

@enebo enebo closed this in 043ea6f Nov 22, 2016
@enebo enebo added this to the JRuby 9.1.7.0 milestone Jan 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment