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

Setting SO_LINGER completely inconsistent #4040

Closed
etehtsea opened this issue Jul 29, 2016 · 4 comments
Closed

Setting SO_LINGER completely inconsistent #4040

etehtsea opened this issue Jul 29, 2016 · 4 comments

Comments

@etehtsea
Copy link
Contributor

etehtsea commented Jul 29, 2016

MRI works / JRuby unsupported:
s.setsockopt(Socket::Option.linger(true, 0))


MRI works / JRuby accepted, but does nothing (broken):

require 'socket'; s = Socket.tcp('localhost', 6379); s.setsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER, [1,0].pack('ii')); s.close

MRI:

17358   7700.821842 127.0.0.1   127.0.0.1   TCP 44  62123 → 6379 [RST, ACK] Seq=1 Ack=1 Win=408288 Len=0

JRuby:

17291   7541.692073 127.0.0.1   127.0.0.1   TCP 56  62096 → 6379 [FIN, ACK] Seq=1 Ack=1 Win=408288 Len=0 TSval=457027447 TSecr=457027443
17292   7541.692126 127.0.0.1   127.0.0.1   TCP 56  6379 → 62096 [ACK] Seq=1 Ack=2 Win=408288 Len=0 TSval=457027447 TSecr=457027447
17293   7541.692133 127.0.0.1   127.0.0.1   TCP 56  [TCP Dup ACK 17289#1] 62096 → 6379 [ACK] Seq=2 Ack=1 Win=408288 Len=0 TSval=457027447 TSecr=457027447
17294   7541.692164 127.0.0.1   127.0.0.1   TCP 56  6379 → 62096 [FIN, ACK] Seq=1 Ack=2 Win=408288 Len=0 TSval=457027447 TSecr=457027447
17295   7541.692252 127.0.0.1   127.0.0.1   TCP 56  62096 → 6379 [ACK] Seq=2 Ack=2 Win=408288 Len=0 TSval=457027447 TSecr=457027447

MRI unsupported / JRuby broken:

MRI:

[7] pry(main)> require 'socket'; s = Socket.tcp('localhost', 6379); s.setsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER, 0); s.close
Errno::EINVAL: Invalid argument - setsockopt(2)
from (pry):7:in `setsockopt'

JRuby same as previous.


MRI unsupported / JRuby actually works:

require 'socket'; s = Socket.tcp('localhost', 6379); s.setsockopt(Socket::SOL_SOCKET, :LINGER, 0); s.close

MRI same as previous.

JRuby:

require 'socket'; s = Socket.tcp('localhost', 6379); s.setsockopt(Socket::SOL_SOCKET, :LINGER, 0); s.close
=> nil
17553   8085.477203 127.0.0.1   127.0.0.1   TCP 44  62165 → 6379 [RST, ACK] Seq=1 Ack=1 Win=408288 Len=0
@headius
Copy link
Member

headius commented Aug 24, 2016

@etehtsea This is fixed now, right?

@etehtsea
Copy link
Contributor Author

etehtsea commented Aug 25, 2016

@headius nope. Even in #4093
If you want this in 9.1.3.0 it's possible to get some Socket::Option related commits from #4093 and fix this upon them. There was preparation PR #4074

etehtsea added a commit to etehtsea/jruby that referenced this issue Aug 27, 2016
@etehtsea
Copy link
Contributor Author

@headius I've prepared PR #4119 that fixes this issue.

etehtsea added a commit to etehtsea/jruby that referenced this issue Aug 28, 2016
etehtsea added a commit to etehtsea/jruby that referenced this issue Aug 28, 2016
@enebo enebo modified the milestones: JRuby 9.1.4.0, JRuby 9.1.3.0 Aug 29, 2016
@enebo
Copy link
Member

enebo commented Aug 29, 2016

@etehtsea we will try and get the branch you and @headius have been working on landed early in 9.1.4.0 but it will miss 9.1.3.0

etehtsea added a commit to etehtsea/jruby that referenced this issue Aug 31, 2016
etehtsea added a commit to etehtsea/jruby that referenced this issue Sep 7, 2016
etehtsea added a commit to etehtsea/jruby that referenced this issue Sep 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants