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

sendmsg_nonblock with exception: false gobbling all errors #2400

Closed
HoneyryderChuck opened this issue Jul 13, 2021 · 4 comments
Closed

sendmsg_nonblock with exception: false gobbling all errors #2400

HoneyryderChuck opened this issue Jul 13, 2021 · 4 comments
Assignees
Labels
Milestone

Comments

@HoneyryderChuck
Copy link
Contributor

Reproducible with:

require "socket"

host = "fe80::1213:31ff:fe67:8b94"
ip = IPAddr.new(host)
udp  = UDPSocket.new(ip.family)

puts udp.sendmsg_nonblock("bla", 0, Socket.sockaddr_in(53, host), exception: false)

In CRuby, this raises No route to host - sendmsg(2) (Errno::EHOSTUNREACH), whereas in truffleruby, it return :wait_writable.

Bottom line is, connectivity errors shouldn't be gobbled.

Observed this behaviour with 21.1.0

@eregon
Copy link
Member

eregon commented Jul 13, 2021

@HoneyryderChuck Trying that script (+ require 'ipaddr') on CRuby I get:

$ ruby -v sendmsg.rb
ruby 2.7.3p183 (2021-04-05 revision 6847ee089d) [x86_64-linux]
3

And the same on truffleruby-dev and 21.1.0.

@HoneyryderChuck
Copy link
Contributor Author

Probably because your IPv6 connectivity works better (kudos to your ISP provider 😂 ).

Maybe try it out with some other unreachable IP?

@HoneyryderChuck
Copy link
Contributor Author

You can set the following ip table rule:

ip route add unreachable 192.168.2.1

And use that IP. Also doable from within truffleruby's docker container.

@eregon eregon self-assigned this Jul 14, 2021
@eregon eregon added the bug label Jul 14, 2021
@eregon eregon added this to the 21.3.0 milestone Jul 14, 2021
@eregon
Copy link
Member

eregon commented Jul 14, 2021

Thanks, I could reproduce with that, fix coming.

graalvmbot pushed a commit that referenced this issue Jul 15, 2021
…n a Symbol for EAGAIN/EWOULDBLOCK (#2400)

PullRequest: truffleruby/2800
wildmaples pushed a commit to Shopify/truffleruby that referenced this issue Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants