Commit Graph

190 Commits

Author SHA1 Message Date
Mahak Mukhi 661dbbc817 conflict resolve 2017-03-06 13:19:09 -08:00
Doug Fawley 77204bfdf2 Add comment explaining why cancel is not called in success path after client transport is created 2017-03-03 16:46:26 -08:00
Mahak Mukhi bc3cca9945 Implementation changes;Using an independent goroutine for keepalive checks. 2017-02-28 11:49:51 -08:00
Mahak Mukhi 336b4ea3cf post review update 2017-02-10 16:47:43 -08:00
Chris Roche c7430a063e Only override :authority for insecure dials 2017-02-09 10:46:00 -08:00
Chris Roche 84bee50bda Add DialOption to overwrite :authority pseudo-header
The :authority pseudo-header for a gRPC Client defaults to the host
portion of the dialed target and can only be overwritten by providing a
TransportCredentials. However, there are cases where setting this header
independent of any tranport security is valid. In my particular case,
in order to leverage Envoy for request routing, the cluster/service name
must be provided in the :authority header. This may also be useful in a
testing context.

This patch adds a DialOption to overwrite the authority header,
even if TransportCredentials are provided (I'd imagine you'd only ever
need to specify one or the other).
2017-02-03 17:29:18 -08:00
Mahak Mukhi 0bdf059601 post review updates 2017-01-31 16:09:40 -08:00
Mahak Mukhi 5fcb58f02d post review updates 2017-01-30 11:32:54 -08:00
Mahak Mukhi e78a1f396d conflict resolve 2017-01-27 11:18:35 -08:00
Menghan Li cb653e4b61 Change stats APIs (#1030)
Change stats API from one static handler to one handler per server or client.
2017-01-09 17:11:32 -08:00
Mahak Mukhi 49d2a88c27 Comment formatting 2017-01-06 17:18:22 -08:00
Mahak Mukhi eeb6f5bade code cleaning 2017-01-06 16:52:37 -08:00
Qi Zhao 09aecb094e Add the initial service config support (#1009)
* Add the initial service config support

* start scWatcher later

* remove timeoutCh

* address the comments

* deal with dial timeout

* defer cancel for the newly created context for correct lifetime management

* fix the defer order

* added other 2 missing cancels
2016-12-19 16:31:00 -08:00
Mahak Mukhi 058907d033 refactored and rectified test failures 2016-11-18 13:55:04 -08:00
Mahak Mukhi e58450b5d3 Keepalive client-side implementation 2016-11-17 17:50:52 -08:00
Menghan Li c31bccc236 add FailOnNonTempDialError to control if gRPC should fail on non-temp dial error 2016-11-15 11:14:07 -08:00
Menghan Li df5d48b597 fix comments 2016-11-09 17:35:47 -08:00
Menghan Li 947e436ef4 return non temporary connection error if dialer returns non temprary errors 2016-11-09 17:25:46 -08:00
iamqizhao 2d5f9a12ea grpclb: Support DropRequest 2016-10-18 18:08:32 -07:00
iamqizhao 8930da46d0 grpclb: work with LoadBalanceToken 2016-10-13 16:54:33 -07:00
Menghan Li 1a79a7e346 Use creds.Clone in balancer.start 2016-09-27 17:36:19 -07:00
iamqizhao f02984b7c6 Basic support of grpclb 2016-09-19 15:11:57 -07:00
Zellyn Hunter a45515c6ca Log grpc.Address objects with %v, not %q
Structs should use %v; %q only makes sense for strings, chars, etc.
2016-09-12 15:09:10 -04:00
Menghan Li 74f7afb1f9 Move balancer initialization into a goroutine 2016-09-08 15:13:50 -07:00
Menghan Li a00cbfeab5 Overwrite authority if creds servername is specified 2016-09-06 11:23:30 -07:00
iamqizhao 61f62e0da6 Merge branch 'master' of https://github.com/grpc/grpc-go 2016-08-26 13:51:46 -07:00
iamqizhao 1e47e17230 Support client side interceptor 2016-08-26 13:50:38 -07:00
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