-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: KeepAlive should be backward compatible in 1.23 #69295
Comments
Related Issues and Documentation (Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
please include a test that reproduces the issue |
Yes, it would be very helpful to see a test. The package is intended to work as you describe: if |
Looks like I was wrong, and just misunderstanding a different part of this change. A colleague pointed me at the original issue #62254 which had some additional details that didn't make it into the release notes. Our test was fairly low level and was doing a syscall against a TCP socket and checking the value of Part of the #62254 work was changing So it is probably at least mostly identical behaviorally, and fairly simple to update or tests to check for this different property that's being set now instead. Sorry for the noise and thanks for the help. I'll go ahead and close this. Here's the original failing test if anybody is interested in details. |
Thanks for following up. |
We upgraded to go1.23.1 to utilize We noticed the same change in behavior for
While I see this was one of the proposed changes in #62254 and understand the author's rationale where a user who sets |
@panjf2000 We should expand the release notes to describe these kinds of changes. Would you able to write a patch for golang.org/x/website/_content/doc/go1.23.md? Thanks. |
Sure, I'll send a patch updating the release notes of go1.23 later. |
Go version
1.22 and 1.23
Output of
go env
in your module/workspace:What did you do?
https://go.dev/doc/go1.23#netpkgnet
We upgrade our tests to use golang 1.23 and started getting failures because our assertions that the KeepAlive for a connection we create are the same as what we configure in our DialContext started failing.
The
KeepAliveConfig
addition in 1.23 is great, but the fact thatKeepAlive
is now ignored in 1.23 is problematic.For library authors that are trying to support 1.22 as a minimum version, they can't use the new
KeepAliveConfig
, but if they continue to useKeepAlive
consumers importing their package and using 1.23 will not have the correct behavior.What did you see happen?
KeepAlive on a DialContext in 1.23 seems to be ignored
What did you expect to see?
KeepAlive should still work in 1.23, and if both KeepAlive and KeepAliveConfig are specified, KeepAliveConfig is used.
The text was updated successfully, but these errors were encountered: