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

net: UDPConn.ReadFromUDP returns non-nil Addr for generic errors #46238

Closed
prattmic opened this issue May 18, 2021 · 2 comments
Closed

net: UDPConn.ReadFromUDP returns non-nil Addr for generic errors #46238

prattmic opened this issue May 18, 2021 · 2 comments
Assignees
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@prattmic
Copy link
Member

What version of Go are you using (go version)?

tip

Does this issue reproduce with the latest release?

Not 1.16

What operating system and processor architecture are you using (go env)?

linux/amd64

What did you do?

https://play.golang.org/p/IGSlLDraksK

What did you expect to see?

On 1.16, I see:

n = 0, addr = (*net.UDPAddr)(nil), err = read udp 127.0.0.1:1234: i/o timeout

What did you see instead?

On tip, I see:

n = 0, addr = &net.UDPAddr{IP:net.IP(nil), Port:0, Zone:""}, err = read udp 127.0.0.1:1234: i/o timeout

i.e., ReadFromUDP no longer returns a nil Addr for generic (non-address-specific) errors.

This breaks an internal test which retries if it receives a non-nil Addr and error from ReadFromUDP. (I'm actually unsure if it is possible to get a valid address along with an error? If not, perhaps this test is just broken.)

Either way, this change was caused by http://golang.org/cl/291509, where the difference in behavior appears to be unintentional, so I think it should be fixed.

cc @FiloSottile

@prattmic prattmic added the NeedsFix The path to resolution is known, but the work has not been done. label May 18, 2021
@prattmic prattmic added this to the Go1.17 milestone May 18, 2021
@prattmic prattmic self-assigned this May 18, 2021
@gopherbot
Copy link

Change https://golang.org/cl/320909 mentions this issue: net: return nil UDPAddr from ReadFromUDP

@heschi
Copy link
Contributor

heschi commented May 18, 2021

Marking as release blocking just for safety's sake.

@golang golang locked and limited conversation to collaborators May 19, 2022
@prattmic prattmic self-assigned this Jun 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

3 participants