Commit Graph

163 Commits

Author SHA1 Message Date
Tamir Duberstein dd5645bebf
Avoid goroutine leak in clientconn
Prior to this change, it was possible for `DialContext` to return
`(nil, err)` without properly closing the `ClientConn`, resulting in an
unavoidable leak of the `resetAddrConn` goroutine.
2016-08-25 17:02:43 -04:00
iamqizhao 6cc4c5785d refactor to simplify 2016-08-24 12:56:16 -07:00
iamqizhao 9dbd95fe38 make the test failure consistent 2016-08-24 11:02:18 -07:00
iamqizhao 7873a050d4 fix the test 2016-08-24 10:46:06 -07:00
iamqizhao 7eae19acb7 fix the issue 2016-08-23 19:23:04 -07:00
iamqizhao 60c350b0e9 Detach user-passed context (via DialContext(...)) with the context of ClientConn 2016-08-23 18:18:18 -07:00
Menghan Li f3ac95e6cd Check if cc.conns == nil before reading cc.conns 2016-08-18 16:43:58 -07:00
Qi Zhao 8a81ddda27 Merge pull request #831 from spencerkimball/spencerkimball/dial-with-context
Implement DialContext to afford caller option of managing cancelation
2016-08-17 11:18:27 -07:00
Menghan Li c72b08a774 Change errors returned by ac.wait() 2016-08-16 16:56:16 -07:00
Spencer Kimball b38541aeb0 Implement DialContext to afford caller option of managing cancelation 2016-08-16 16:57:59 -04:00
Menghan Li a9c8aebe90 Make non-failfast RPC get new transport instead of waiting 2016-08-12 13:03:09 -07:00
Tamir Duberstein 5e62f80ba8
resetTransport: log all transient errors when they occur
Previously, cancellation of the context would cause these transient
errors to be swallowed since the function would return before the
log line was reached.
2016-08-10 12:56:03 -04:00
Menghan Li a4587cd3f0 Fix review comments 2016-08-02 21:07:00 -07:00
Menghan Li fa5748afd3 Change error returned for transport not found 2016-08-01 16:01:16 -07:00
Menghan Li f6b46c1787 Fix errors after rebasing 2016-08-01 16:01:10 -07:00
Menghan Li d7d831d95e Do not create RoundRobin if balancer is not specified 2016-08-01 15:55:08 -07:00
Menghan Li 7c6eabc607 Make Dial() return original error 2016-08-01 15:55:08 -07:00
Menghan Li 1d0bea7943 Add addrConn tearDownError 2016-08-01 15:55:08 -07:00
Menghan Li e9e6ae6215 Make Dial() withblock error on bad certificates 2016-08-01 15:55:08 -07:00
Tamir Duberstein 5c7ed938f9
credentials: plumb cancellation into ClientHandshake
This is a minor breaking change to `TransportCredentials`, however
it should not be a problem in practice as not many users are using
custom implementations. In particular, users of `NewTLS` will not
be affected.

This change also replaces the earlier `Timeout` and `Cancel` fields
with a `context.Context`, which is plumbed all the way down from
`grpc.Dial`, laying the ground work for a user-provided context.

Also, support for Go 1.7 is added.
2016-08-01 16:29:56 -04:00
iamqizhao 21c5a43e47 fix a race condition causing http2Client.controller leaking 2016-08-01 11:51:20 -07:00
Menghan Li cbae5b1f01 Replace cc.newAddrConn with cc.resetAddrConn
When goaway is received by client, a new ac should replace the old ac.
Without this change, ac is removed first and a new one is added later,
ac.tearDown() and cc.newAddrConn are two functions called consecutively,
So there's a small chance that getTransport is called in between and
misses the new ac. After this change, the value in map conns is replaced
directly, and this issue should be resolved.
2016-07-29 16:03:53 -07:00
iamqizhao a09c6888cc fix another data race along with goaway 2016-07-28 19:47:38 -07:00
Menghan Li f255f72742 Merge pull request #784 from iamqizhao/race-fix
Fix a couple of races when goaway lives with connection shutdown.
2016-07-28 15:40:27 -07:00
Tamir Duberstein 096e703537
WithDialer doesn't support cancellation
This maintains cancellation for the default dialer, but external users
will have to opt in via a future API.
2016-07-28 17:00:23 -04:00
iamqizhao b128e7465a merge the conflict 2016-07-28 13:17:23 -07:00
iamqizhao cd4ca4d808 Tune transport Monitor, modify the test and add more comments 2016-07-28 11:07:42 -07:00
iamqizhao 1faf2ca61b fix the race on t.state 2016-07-27 19:46:34 -07:00
iamqizhao 63fcabeec5 some polish 2016-07-27 17:41:43 -07:00
iamqizhao 110450d45e fix races introduce by goaway 2016-07-27 17:27:10 -07:00
Tamir Duberstein 61f3f61ef0
cancel outgoing net.Dial when ClientConn is closed 2016-07-27 17:34:40 -04:00
Tamir Duberstein 2342e38669
test,transport: simplify 2016-07-27 17:20:55 -04:00
iamqizhao f1e4d3b180 allow multiple GoAways and retrying on illegal streams 2016-07-25 16:35:32 -07:00
iamqizhao 046e606dc5 clean up 2016-07-21 18:12:01 -07:00
iamqizhao 9ad4c58355 Make it work for streaming 2016-07-21 16:19:34 -07:00
iamqizhao 873cc272c2 support goaway 2016-07-20 18:48:49 -07:00
iamqizhao d2e79470cc client goaway support 2016-07-19 16:29:13 -07:00
iamqizhao f492622da4 rebase 2016-07-06 14:16:27 -07:00
Tamir Duberstein ebd9633b55
remove duplicate balancer field 2016-07-05 14:52:25 -04:00
iamqizhao be59d023f2 refactor error handling a bit 2016-06-29 15:21:44 -07:00
iamqizhao 213a20c4fe bug fix, typo fix and slight error refactoring 2016-06-28 16:08:19 -07:00
iamqizhao 01ef81a4d9 minor fix including removal of debugging logs, error code fix, etc. 2016-06-27 15:30:20 -07:00
iamqizhao 3e71fb360d Support fail-fast mode and make it the default 2016-06-27 14:36:59 -07:00
Qi Zhao 3efe7aef96 Merge pull request #713 from menghanl/split_authenticator_and_credentials
[API revision] Separate TransportAuthenticator and PerRPCCredentials
2016-06-09 14:57:55 -07:00
Menghan Li d9c8fb446d Change errCredentialsMisuse to errCredentialsConflict and errTransportCredentialsMissing 2016-06-08 13:53:41 -07:00
Menghan Li 59486d9c17 Rename TransportAuthenticator to TransportCredentials 2016-06-08 11:19:25 -07:00
Anthony Romano eada4fb145 clientconn: buffer waitC on Dial goroutine
Leaks a goroutine on dial timeout if unbuffered.
2016-06-07 15:47:54 -07:00
Menghan Li 3ffbd8e030 Rename Credentials to PerRPCCredentials 2016-06-06 17:28:10 -07:00
Menghan Li f0feaea314 Should be only one TransportAuthenticator 2016-06-06 16:35:41 -07:00
Menghan Li 6404c49192 Make TransportAuthenticator not embed Credentials 2016-06-06 16:24:46 -07:00