-
Notifications
You must be signed in to change notification settings - Fork 914
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
IPSocket#addr returning "0:0:0:0:0:0:0:0" as bound ip address and not "::" when preferring IPv6 #8183
Comments
I suspect this is due to differences in that environment relaing to IPv6 and the Java/JDK being run. You say that locally it's "0:0:0:0" which seems a strange address to me, given that the catch-all address for IPv6 should be "0:0:0:0:0:0:0:0" as you say it does on Gitlab CI. Do you mean "0.0.0.0"? There are some JVM properties you can set (with https://docs.oracle.com/javase/8/docs/technotes/guides/net/ipv6_guide/#ipv6-related |
I managed to reproduce this locally. This just seems to be different behaviour from jruby, i.e. returning "0:0:0:0:0:0:0:0" instead of "::" for loopback addresses: require "socket"
server = TCPServer.new(0)
puts server.addr.inspect
#=> jruby: ["AF_INET6", 52341, "0:0:0:0:0:0:0:0", "0:0:0:0:0:0:0:0"]
#=> ruby: ["AF_INET6", 52343, "::", "::"] bottom line, this manifested in CI because the gitlab docker executor seems to have IPv6 enabled recently for loopback, which triggered this error on the jruby job. Either that, or it has been enabled all along, and this is therefore a regression. |
@headius shall the label be readded again based on the feedback above? |
Kind of mind-blowing with how many socket specs exist that this is not covered at all. On my machine MRI is emitting ipv4 with 0.0.0.0. JRuby is not but I think that is just as @headius said. If we do:
@HoneyryderChuck your workaround for the moment would be to set that property in CI so you get ipv4. We I guess need to add a spec and change how we emit ipv6 here. Every time I look this stuff up it is out of my mind about a day later. |
I think in just a minute or two of perusing that for all intents and purposes "0:0:0:0:0:0:0:0" means "::". So you could argue this is a valid unspecified address in either form and should still function by anything receiving it. That said, we should just output the same thing vs making some other projects deal with accepting both. |
Indeed, I should have been more specific about that. Thx for the patch 🙏 |
Fix #8183. IPSocket#addr should report :: vs long unspecified address
An outstanding item to this issue and likely others is we need to make some CI job which runs socket specs in both ipV4 and ipV6. It will need to get addressed later. |
Environment Information
Provide at least:
Expected Behavior
The httpx jruby suite started failing recently, when a certain proxy test would try to bind to the "0:0:0:0:0:0:0:0" address. This address was collected from here, where I confirmed that, after initiating the server with
TCPServer.new(0)
, the call to.addr
returns"0:0:0:0:0:0:0:0"
in the 3rd and 4th array elements.This seems to only happen on gitlab CI though, as locally it consistently returns
"0:0:0:0"
The text was updated successfully, but these errors were encountered: