-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
internal: use OS defaults for TCP keepalive params only on unix #6841
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #6841 +/- ##
==========================================
- Coverage 83.65% 83.54% -0.11%
==========================================
Files 286 286
Lines 30801 30801
==========================================
- Hits 25766 25734 -32
- Misses 3980 4002 +22
- Partials 1055 1065 +10
|
@@ -1,3 +1,5 @@ | |||
//go:build unix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does seem to work for me. Without any build constraint:
$ GOOS=illumos go build ./internal
$ GOOS=android go build ./internal
$ GOOS=ios go build ./internal
$ GOOS=windows go build ./internal
# google.golang.org/grpc/internal
internal/tcp_keepalive.go:48:10: undefined: unix.SetsockoptInt
internal/tcp_keepalive.go:48:38: undefined: unix.SOL_SOCKET
internal/tcp_keepalive.go:48:55: undefined: unix.SO_KEEPALIVE
And with the build constraint, the windows build passes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't realize we could build for any OS with GOOS. Thanks.
looks like this PR will broke the referencing grpc from bazel. |
@andyliuliming can you file an issue and let us know what's wrong so we can try to fix it? |
thanks, opened one issue: |
In #6834, we made a change to ensure that OS defaults for TCP keepalive params are used. But, that change failed to compile on windows. This fix addresses it.
RELEASE NOTES: none