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..getresource produces different errors then MRI #4104

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

Comments

Projects
None yet
4 participants
@mkristian
Member

mkristian commented Aug 23, 2016

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

This comment has been minimized.

Show comment
Hide comment
@headius

headius Aug 24, 2016

Member

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

Member

headius commented Aug 24, 2016

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

@etehtsea

This comment has been minimized.

Show comment
Hide comment
@etehtsea

etehtsea Nov 22, 2016

Contributor

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

UPD: #4329

Contributor

etehtsea commented Nov 22, 2016

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

UPD: #4329

@enebo enebo closed this in 043ea6f Nov 22, 2016

enebo added a commit that referenced this issue Nov 22, 2016

Merge pull request #4329 from etehtsea/gh-4104-resolv
Add missing PortUnreachable catch. Fixes #4104

@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