-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Set timeout for custom dialer. #1035
Conversation
connector.go
Outdated
|
||
dialCtx = dctx | ||
} | ||
|
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.
Move this block into if ok {
block.
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.
updated, feeling something weird, It seems to have to move all them insied
connector.go
Outdated
} else { | ||
nd := net.Dialer{Timeout: mc.cfg.Timeout} | ||
mc.netConn, err = nd.DialContext(ctx, mc.cfg.Net, mc.cfg.Addr) | ||
mc.netConn, err = nd.DialContext(ctx, mc.cfg.Net, mc.cfg.Addr) // for DialContext shall be ctx, not dialCtx |
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 comment is redundant.
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.
yes, this explains why the dialctx not passed to DialContext, for later puller could get some info.
if you can't accept this redundant comment, I would comit another patch to remove this comment.
remove ?
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 explains why the dialctx not passed to DialContext, for later puller could get some info.
Read the comment. It doesn't explain why. And the code tells why cleary.
So this comment is just a noise. Please remove it.
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.
updated
"Added myself / the copyright holder to the AUTHORS file" |
AUTHORS
Outdated
@@ -86,6 +86,7 @@ Xiangyu Hu <xiangyu.hu at outlook.com> | |||
Xiaobing Jiang <s7v7nislands at gmail.com> | |||
Xiuming Chen <cc at cxm.cc> | |||
Zhenye Xie <xiezhenye at gmail.com> | |||
Jiajia Zhong <zhong2plus at gmail.com> |
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.
See line 9:
# Please keep the list sorted.
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.
thanks to your gude.
This reverts commit 15462c1.
Description
the dial ctx shall be something todo with the cfg.Timeout
Checklist