Commit Graph

236 Commits

Author SHA1 Message Date
Mahak Mukhi 66de296a37 post review update 2017-02-07 14:46:28 -08:00
Mahak Mukhi f9065ac5d2 Added test. 2017-02-07 12:39:32 -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
Rhys Hiltner 417442a753 transport: fix logical race in flow control (#1005)
Remove the add and cancel methods of quotaPool. Their use is not required, and
leads to logical races when used concurrently from multiple goroutines. Rename
the reset method to add.

The typical way that a goroutine claims quota is to call the add method and
then to select on the channel returned by the acquire method. If two
goroutines are both trying to claim quota from a single quotaPool, the second
call to the add method can happen before the first attempt to read from the
channel. When that happens the second goroutine to attempt the channel read
will end up waiting for a very long time, in spite of its efforts to prepare
the channel for reading.

The quotaPool will always behave correctly when any positive quota is on the
channel rather than stored in the struct field. In the opposite case, when
positive quota is only in the struct field and not on the channel, users of
the quotaPool can fail to access available quota. Err on the side of storing
any positive quota in the channel.

This includes a reproducer for #632, which fails on many runs with this
package at v1.0.4. The frequency of the test failures depends on how stressed
the server is, since it's now effectively checking for weird interleavings of
goroutines. It passes reliably with these changes to the transport package.

The behavior described in #734 (an RPC with a streaming response hangs
unexpectedly) matches what I've seen in my programs, and what I see in the
test case added here. If it's a logical flow control bug, this change may well
fix it.

Updates #632
Updates #734
2016-11-30 17:39:40 -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 947e436ef4 return non temporary connection error if dialer returns non temprary errors 2016-11-09 17:25:46 -08:00
iamqizhao b85d2b0be5 Support transport tap 2016-11-03 14:21:24 -07:00
iamqizhao 152ccd8853 remove context.WithCancel which is not needed 2016-10-25 16:53:43 -07:00
iamqizhao 4596c55b7a Use the correct error in defer call 2016-10-25 15:32:12 -07:00
Menghan Li f0b3103754 Disable handler-tls in end2end tests 2016-10-20 13:38:11 -07:00
Mark Nevill bac9e1d16e Make concurrent Server.GracefulStop calls all behave equivalently. 2016-10-17 13:18:45 +01:00
Menghan Li e790079956 Add grpc.SetHeader and ServerStream.SetHeader 2016-10-11 13:58:16 -07:00
Menghan Li 1247834778 Allow multiple calls to setTrailer 2016-09-29 14:38:20 -07:00
Qi Zhao dffd7cdf63 Merge pull request #885 from menghanl/fix_sendheader_error
Make grpc.SendHeader return rpc error
2016-09-29 10:55:26 -07:00
iamqizhao b531d0156b fix the flakiness of TestStreamingRPCTimeoutServerError 2016-09-27 17:07:14 -07:00
Qi Zhao 590256047f Merge pull request #895 from menghanl/creds_clone
[API revision] Change TransportCredentials interface
2016-09-26 16:22:07 -07:00
Menghan Li 033c91440b Fix testStreamingRPCTimeoutServerError 2016-09-26 16:11:18 -07:00
Menghan Li e63e0d4095 Add Clone() and OverrideServerName() to TransportCredentials 2016-09-26 15:18:51 -07:00
Menghan Li 1c20514d29 Make grpc.SendHeader return rpc error 2016-09-09 11:36:01 -07:00
Menghan Li 52f6504dc2 Merge pull request #867 from iamqizhao/master
Support client side interceptor
2016-09-02 15:12:15 -07:00
Menghan Li 5060203263 fixes in end2end tests 2016-09-02 14:15:26 -07:00
Menghan Li 477d54e0c9 Do not send reset stream on context timeout 2016-09-02 14:15:23 -07:00
Menghan Li 5e734ab23e Avoid creating transport stream error outside of transport 2016-09-02 11:57:42 -07:00
Qi Zhao 4c8d05f3b1 Merge pull request #864 from tamird/retry-timeout
transport: robustly detect temporary errors
2016-08-26 15:02:58 -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
Qi Zhao d736c1182a Merge pull request #851 from menghanl/server_cred_return_nil_conn
Add credentials ErrConnDispatch to tell gRPC to keep rawConn open
2016-08-26 11:50:23 -07:00
Menghan Li d4b6ce0cfe Merge pull request #861 from iamqizhao/master
Add an err logging to testFailFast
2016-08-26 10:33:23 -07:00
Tamir Duberstein e1b61502bc
test: remove useless local variable 2016-08-25 21:30:54 -04:00
Tamir Duberstein 4775d9da13
test: DRY 2016-08-25 21:30:54 -04:00
Tamir Duberstein 1689a9c9eb
test: output codes as strings in failure messages 2016-08-25 21:30:52 -04:00
iamqizhao 935fb215d6 fix 2016-08-25 16:30:04 -07:00
iamqizhao 42e031a928 Use fmt instead grpclog 2016-08-25 15:13:27 -07:00
iamqizhao 4c15c984f2 change to Printf 2016-08-25 15:04:02 -07:00
iamqizhao 152c95e0d8 add err logging to testFailFast 2016-08-24 16:34:37 -07:00
Menghan Li 0c58a17d6f Add credentials ErrConnDispatch 2016-08-24 16:20:57 -07:00
Menghan Li d3a6b8a57f Add TestNonFailFastRPCSucceedOnTimeoutCreds 2016-08-24 15:38:04 -07:00
Tamir Duberstein abe69848df
travis: update all the tools
Fix new golint complaints
2016-08-18 16:53:48 -04:00
Menghan Li 35896af9ad Merge pull request #768 from menghanl/fatal_on_bad_certificates
Return error on bad certificates
2016-08-02 21:27:28 -07:00
Menghan Li 63e2ba4fce Temporarily disable handler-tls for TestClientStreamingError due to #619 2016-08-01 16:52:41 -07:00
Menghan Li f6b46c1787 Fix errors after rebasing 2016-08-01 16:01:10 -07:00
Menghan Li 4bbb9d8142 Add test env for no-balancer 2016-08-01 15:55:08 -07:00
Menghan Li 1a571b746a Add TestFailFastRPCWithNoBalancerErrorOnBadCertificates TestNonFailFastRPCWithNoBalancerErrorOnBadCertificates 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 b41c9e8e14 Add TestFailFastRPCErrorOnBadCertificates 2016-08-01 15:55:08 -07:00
Menghan Li 779083c633 Change TestDialWithBlockErrorOnBadCertificates error check 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 5a423e610f
test: fix log noise 2016-08-01 16:28:14 -04:00
iamqizhao 21c5a43e47 fix a race condition causing http2Client.controller leaking 2016-08-01 11:51:20 -07:00
iamqizhao 058603d782 Merge branch 'master' of https://github.com/grpc/grpc-go 2016-07-30 11:40:40 -07:00