-
Notifications
You must be signed in to change notification settings - Fork 592
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
Use WithContextDialer to replace WithDialer #472
Conversation
close in favor of https://gitlab.com/nvidia/kubernetes/device-plugin/-/merge_requests/345 |
@kerthcet please reopen this. We are migrating to GitHub and I will review it here. |
/reopen |
//nolint:staticcheck | ||
grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) { | ||
return net.DialTimeout("unix", addr, timeout) | ||
grpc.WithContextDialer(func(ctx context.Context, addr string) (net.Conn, error) { |
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.
One question I have: How does the change in default TCP timeout as described in https://pkg.go.dev/google.golang.org/grpc#WithContextDialer
Note: All supported releases of Go (as of December 2023) override the OS defaults for TCP keepalive time and interval to 15s. To enable TCP keepalive with OS defaults for keepalive time and interval, use a net.Dialer that sets the KeepAlive field to a negative value, and sets the SO_KEEPALIVE socket option to true from the Control field. For a concrete example of how to do this, see internal.NetDialerWithTCPKeepalive().
affect this change here?
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 think they're different, one is for detecting network liveness, another is for waiting for the network connection. WithDialer
also uses WithContextDialer
underlying.
Signed-off-by: kerthcet <kerthcet@gmail.com>
Cleanup for TODO.