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

Socket.unix and friends use missing Addrinfo features #3229

Closed
headius opened this issue Aug 6, 2015 · 4 comments · Fixed by #4152
Closed

Socket.unix and friends use missing Addrinfo features #3229

headius opened this issue Aug 6, 2015 · 4 comments · Fixed by #4152

Comments

@headius
Copy link
Member

headius commented Aug 6, 2015

Reported on IRC...

Trying to use Socket.unix("path") fails with IOError: path: Name or service not known

This method and a few others like it are implemented using Addrinfo to produce the new socket. Since Addrinfo is not fully implemented on JRuby, there's some missing pieces here.

This affects at least JRuby 1.7 and may affect 9k, but I have not confirmed.

@etehtsea
Copy link
Contributor

etehtsea commented Jul 1, 2016

Issue remains in 9k:

>> >> require 'socket'; Socket.unix('/Users/kes/Projects/redis/oxblood/tmp/redis-91928c35e0bd.sock')
IOError: /Users/kes/Projects/redis/oxblood/tmp/redis-91928c35e0bd.sock: unknown error
    from org/jruby/ext/socket/Addrinfo.java:119:in `initialize'
    from org/jruby/ext/socket/Addrinfo.java:245:in `unix'
    from /Users/kes/.rbenv/versions/jruby-9.1.3.0-SNAPSHOT/lib/ruby/stdlib/socket.rb:772:in `unix'
    from (irb):1:in `<eval>'
    from org/jruby/RubyKernel.java:981:in `eval'
    from org/jruby/RubyKernel.java:1288:in `loop'
    from org/jruby/RubyKernel.java:1101:in `catch'
    from org/jruby/RubyKernel.java:1101:in `catch'
    from /Users/kes/.rbenv/versions/jruby-9.1.3.0-SNAPSHOT/bin/jirb:13:in `<top>'

Same line works in MRI:

>> require 'socket'; Socket.unix('/Users/kes/Projects/redis/oxblood/tmp/redis-91928c35e0bd.sock')
=> #<Socket:fd 9>

etehtsea added a commit to etehtsea/oxblood that referenced this issue Jul 1, 2016
@enebo
Copy link
Member

enebo commented Jul 1, 2016

@etehtsea the second example working is MRI demonstrating it should work? Or was it a typo showing what your PR does in that UnixSocket.new works?

@etehtsea
Copy link
Contributor

etehtsea commented Jul 1, 2016

@enebo sorry, forgot to add description. Yeap, this is demonstration that the same line is working in MRI.

@headius
Copy link
Member Author

headius commented Jul 11, 2016

This should be improved on the ruby-2.3+socket branch but I have not completed that work yet :-(

headius added a commit that referenced this issue Sep 22, 2016
@enebo enebo added this to the Invalid or Duplicate milestone Nov 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants