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
replace grpc.FailFast and grpc.WithDialer which is deprecated #83003
Conversation
/cc @liggitt |
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.
Overall, this makes sense to me (although I defer to anyone with more grpc experience than me :) )
Confirming this shouldn't cause a functionality change, correct?
One small note around the typecheck failure... I'm wondering if this needs to be coupled with winio
update?
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) { | ||
return (&net.Dialer{}).DialContext(ctx, "unix", addr) |
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.
do we still need to call WithContextDialer (I expected this to be the default implementation... xref https://github.com/grpc/grpc-go/blob/master/clientconn.go#L198-L203)
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.
Looks to me that switching to WithTimeout
and using the default dialer impl like @liggitt suggested should preserve the previous behavior.
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.
@liggitt @jpbetz
Maybe we can simple write like this :
c, err := grpc.DialContext(ctx, unixSocketPath, grpc.WithInsecure(), grpc.WithBlock())
Because
grpc.WithDialer
is actually set timeout viacontext.deadline
, xref https://github.com/grpc/grpc-go/blob/788ffe62759ade61e0d6273e480c9e8f3d09d30d/dialoptions.go#L358-L360grpc.DialContext
finally calldial.DialContext
which will set deadline from context. xref https://github.com/golang/go/blob/cf06b9aa81004a017e5c98422fce2fafd1f24921/src/net/dial.go#L368-L370
These two approach is the same, right ?
If so, we can safely skip this option.
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) { | ||
return (&net.Dialer{}).DialContext(ctx, "unix", addr) |
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.
same question as https://github.com/kubernetes/kubernetes/pull/83003/files#r327111524
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) { | ||
return (&net.Dialer{}).DialContext(ctx, "unix", addr) |
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.
same question as https://github.com/kubernetes/kubernetes/pull/83003/files#r327111524
I don't have context on the failfast / WaitForReady change... who would be a good reviewer for that? |
/assign @jingyih |
@roycaihw: GitHub didn't allow me to assign the following users: jingyih. Note that only kubernetes members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: danielqsj The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -60,6 +61,7 @@ require ( | |||
) | |||
|
|||
replace ( | |||
github.com/pkg/errors => github.com/pkg/errors v0.8.0 |
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.
@liggitt after execute hack/update-vendor.sh
, this go.mod
changed to this. Should I keep it or change it to v0.8.1 ?
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.
change it to v0.8.1 (https://github.com/microsoft/go-winio/blob/v0.4.14/go.mod#L6)
@danielqsj: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
the vendor bump is unrelated, can you move that to a separate PR? the FailFast(x) to WaitForReady(!x) change is straightforward. the WithContextDialer change needs much closer review to make sure we have equivalent behavior. can you split those changes so we can go ahead and merge the first? |
@danielqsj: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What type of PR is this?
/kind bug
/area apiserver
What this PR does / why we need it:
Now the
grpc.FailFast
andgrpc.WithDialer
has deprecated, so usegrpc.WaitForReady
andgrpc.WithContextDialer
instead.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: