Commit Graph

236 Commits

Author SHA1 Message Date
iamqizhao 2f16a90cc7 tune a end2end test 2016-07-30 11:18:58 -07:00
iamqizhao fc500c24f6 fix go vet error 2016-07-29 18:08:00 -07:00
iamqizhao a4c08780d5 Merge branch 'master' of https://github.com/grpc/grpc-go 2016-07-29 10:10:58 -07:00
Tamir Duberstein 069ed42115
Fix deadlock when GracefulStop()ing multiple times
Fixes #793.
2016-07-29 12:26:26 -04:00
iamqizhao 5876dcba5e a minor fix 2016-07-28 18:57:53 -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 c3a89f91a6 Merge branch 'master' of https://github.com/grpc/grpc-go 2016-07-28 13:04:50 -07:00
Qi Zhao 38383692ba Merge pull request #778 from tamird/golint-govet
*: enforce various linters
2016-07-28 11:22:02 -07:00
iamqizhao cd4ca4d808 Tune transport Monitor, modify the test and add more comments 2016-07-28 11:07:42 -07:00
Tamir Duberstein 220b464e81
*: golint 2016-07-27 23:38:59 -04: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 8c908a8c1d Reject over-sized requests on server 2016-07-26 16:44:49 -07:00
iamqizhao b12fa98959 small touchup 2016-07-25 17:41:47 -07: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 1ea428008b add the missing close(s.done) 2016-07-15 16:55:51 -07:00
iamqizhao ec7eacfcc4 some fix 2016-07-15 11:02:03 -07:00
iamqizhao 7b7cb1ae8c fix bugs and flaky tests 2016-07-14 17:12:11 -07:00
iamqizhao 48068bbe62 remove debugging info 2016-07-13 18:13:28 -07:00
iamqizhao 6205cb25ab fix some bugs 2016-07-13 18:05:02 -07:00
iamqizhao f53faa647d minor fix 2016-07-12 19:26:12 -07:00
iamqizhao 2e7aa9a2b1 Error out the send call for a client streaming rpc if the server has returned an error. 2016-07-12 19:24:33 -07:00
Menghan Li 1b5902d709 Fix review comments 2016-07-08 14:15:16 -07:00
Daniel Ruehle 562a45da66 add test to verify that errors defined with same code and description are not considered equal via the error interface 2016-07-08 10:28:36 -07:00
Daniel Ruehle d2125eeb91 fix error comparison 2016-07-08 10:28:36 -07:00
Daniel Ruehle 55fbdb44ea compare error strings, not interfaces 2016-07-08 10:28:36 -07:00
iamqizhao 605ce23104 Merge branch 'master' of https://github.com/grpc/grpc-go 2016-06-30 15:11:56 -07:00
iamqizhao c477cb3b14 fix the flaky test 2016-06-30 14:26:31 -07:00
Menghan Li a6bacfe42c Fix go vet 2016-06-29 13:36:10 -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
Menghan Li 0f84d515bb Remove printing context from end2end_test UnaryCall() 2016-06-07 16:43:16 -07:00
iamqizhao 404e9b67de dial time out 2016-06-06 12:08:11 -07:00
iamqizhao aa08f14740 Merge branch 'master' of https://github.com/grpc/grpc-go 2016-06-01 18:18:43 -07:00
Qi Zhao aecdccadd2 Merge pull request #683 from mwitkow/feature/propagate-authority
make :authority propagate to MD
2016-06-01 18:18:23 -07:00
iamqizhao 5d62215b41 some minor fixes 2016-05-18 16:26:12 -07:00
iamqizhao 162d8d2d33 Tune Invoke behavior for the new Balancer. 2016-05-18 11:18:10 -07:00
Michal Witkowski 1ef2c5293f fix `TestCompressOK` and client reserved HTTP header handling 2016-05-17 14:35:18 +01:00
iamqizhao 5dafdb0a17 Merge branch 'master' of https://github.com/grpc/grpc-go 2016-05-16 18:54:48 -07:00
Qi Zhao e802f420af Merge pull request #681 from menghanl/disable_handlertls_streamserverhandler
Temporarily disable handler-tls for TestStreamServerInterceptor due to #619
2016-05-16 18:51:03 -07:00
iamqizhao 73ff8375a6 Remove debugging logs and add license. 2016-05-16 15:47:46 -07:00
iamqizhao aa532d5baf Fix some issues and remove garbbage files 2016-05-16 15:31:00 -07:00
iamqizhao 03cdc42949 Merge branch 'master' of https://github.com/grpc/grpc-go 2016-05-12 17:02:23 -07:00
Menghan Li 2b2e776a9d Temporarily disable handler-tls for TestStreamServerInterceptor due to #619 2016-05-12 16:28:03 -07:00
iamqizhao 5cb0ac1fcc Merge branch 'master' of https://github.com/grpc/grpc-go 2016-05-11 17:09:07 -07:00
iamqizhao 09176558b4 Merge branch 'master' of https://github.com/grpc/grpc-go 2016-05-11 15:50:31 -07:00
iamqizhao 8d1806945e Release the quota taken in streamsQuota when an rpc is timeout or canceled. 2016-05-11 15:50:22 -07:00
iamqizhao 113bf2f219 Change some compression related error code 2016-05-10 13:54:10 -07:00
iamqizhao 64ed38ebed Merge branch 'master' of https://github.com/grpc/grpc-go 2016-05-06 16:30:45 -07:00
iamqizhao 9c2d8546bf load balancer 2016-05-06 15:47:09 -07:00
iamqizhao af817236f6 skip more go runtime goroutines in leak check. 2016-05-06 15:20:15 -07:00
iamqizhao e4bb85b43f Support the stream interceptor on server side. 2016-04-21 14:58:45 -07:00
iamqizhao 293b2f9fa8 Close errorChan even when there is no pending I/O 2016-04-21 13:42:59 -07:00
iamqizhao 310ca08496 gofmt -w 2016-04-19 16:04:09 -07:00
iamqizhao c321387fd9 the installation of server unary interceptor 2016-04-19 15:54:30 -07:00
iamqizhao eae2b52e5d Temporarily disable handler-tls for TestHealthCheckOff due to #619 2016-04-07 16:01:36 -07:00
iamqizhao b0a5402a2a fix a test error msg 2016-03-30 11:10:27 -07:00
iamqizhao a31af4bde2 Add some comments to the new test. 2016-03-22 10:56:29 -07:00
iamqizhao a098b2c182 Specialize http2.StreamError when the server reads frames 2016-03-21 18:23:30 -07:00
Victor Vieux 047af78181 fix a few typos 2016-03-16 16:40:16 -07:00
Qi Zhao b4b62c5f29 Merge pull request #571 from bradfitz/internal
Remove test-only methods from grpc package.
2016-02-26 14:33:54 -08:00
iamqizhao a5e4790bfe coalesce runtime_mcall cases 2016-02-25 17:36:29 -08:00
iamqizhao d5c0571ebc skip all goroutines in C code for the leak detector 2016-02-25 16:55:22 -08:00
iamqizhao 47353752e9 add more uninteresting goroutines for the leak detector 2016-02-25 14:03:22 -08:00
Brad Fitzpatrick 0f80f5b995 Remove test-only methods from grpc package.
Move the test-only methods to a new internal package so as to not
pollute the godoc, and to prevent people from using them. (Packages
named internal or under internal are private, and enforced by the go
tool)
2016-02-25 13:30:19 -08:00
Qi Zhao 89f694edb4 Merge pull request #569 from bradfitz/error_map
Fix crashes where transports returned errors unhandled by the message parser
2016-02-24 18:22:25 -08:00
Brad Fitzpatrick 110fd99e30 Fix crashes where transports returned errors unhandled by the message parser.
The http.Handler-based transport body reader was returning error types
not understood by the recvMsg parser. See #557 for some background and
examples.

Fix the http.Handler transport and add tests. I copied in a subset of
the http2 package's serverTest type, adapted slightly to work with
grpc. In the process of adding tests, I discovered that
ErrUnexpectedEOF was also not handled by the regular server
transport. Document the rules and fix that crash as well.

Unrelated stuff in this CL:

* make tests listen on localhost:0 instead of :0, to avoid Mac firewall
  pop-up dialogs.

* rename parser.s field to parser.r, to be more idiomatic that it's an
  io.Reader and not anything fancier. (it's not acting like type
  stream, even if that's the typical concrete type)

* move 5 byte temp buffer into parser, rather than allocating it for
  each new message. (drop in the bucket improvement in garbage; more
  to do later)

* rename http2RSTErrConvTab to http2ErrConvTab, per Qi's earlier
  CL. Also add the HTTP/1.1-required error mapping for completeness,
  not that it should ever arise with gRPC, also per Qi's earlier CL
  referenced in #557.
2016-02-24 15:09:17 -08:00
iamqizhao 91254844e8 add more uninteresting goroutines for leak checker 2016-02-23 16:01:42 -08:00
iamqizhao 3839435526 change health check package name 2016-02-18 13:10:06 -08:00
Brad Fitzpatrick b1097423a0 test: improve test readability; use newTest helper everywhere
This removes serverSetUp and clientSetUp. They had too many positional
parameters and weren't readable at the call sites.

With this change, it's now much more obvious how a test differs from
others just be looking at what is tinkered with after newTest.

Change-Id: I59bb06f8029af166002033f2c3f7b8f0b2d20940
2016-02-16 11:15:16 +00:00
Qi Zhao 01de3de50a Merge pull request #546 from bradfitz/quiet
test: reduce end2end log spam
2016-02-16 01:02:10 -08:00
Brad Fitzpatrick ffa8131f46 test: reduce end2end log spam
Filter expected log output by default, unless a flag is provided, or a
test fails.

This makes it possible to see unexpected things. Having noisy tests
makes it too easy to miss actual problems.
2016-02-13 00:33:23 +00:00
Brad Fitzpatrick d2d9c0a73a Fix flakiness of TestCancelNoIO with http.Handler-based server transport.
It wasn't closing the recvBuffer body in all cases during shutdown.

This change also:

* adds a new test with concurrent streams doing their own serial sends.
  This test was part of earlier debugging, but exists now to add more
  test coverage around concurrency.

* starts a cleanup of the end2end testing code, to be continued later.
  but the cleanup was necessary when writing the new test to be clean
  and not add more positional parameters.

* documents the concurrency expectations of the ServerTransport
  interface, cleaning up some other nearby documentation in the
  process.

* speeds up TestCancelNoIO to cancel some contexts once no longer
  needed, adding some comments about what the test is doing, adds some
  TODOs, and reduces some overly-long sleeps.
2016-02-12 23:24:53 +00:00
Brad Fitzpatrick 7346c871b0 Add a ServeHTTP method to *grpc.Server
This adds new http.Handler-based ServerTransport in the process,
reusing the HTTP/2 server code in x/net/http2 or Go 1.6+.

All end2end tests pass with this new ServerTransport.

Fixes grpc/grpc-go#75

Also:
Updates grpc/grpc-go#495 (lets user fix it with middleware in front)
Updates grpc/grpc-go#468 (x/net/http2 validates)
Updates grpc/grpc-go#147 (possible with x/net/http2)
Updates grpc/grpc-go#104 (x/net/http2 does this)
2016-02-12 00:16:28 +00:00
Qi Zhao 3c4302b713 Merge pull request #543 from bradfitz/teststuff
test: misc cleanups
2016-02-10 16:46:20 -08:00
Brad Fitzpatrick a62244ef28 test: misc cleanups
* test header and metadata separately
* fix an incorrect error message
* ignore optional header fields in response (date, trailer)
2016-02-10 21:37:18 +00:00
Brad Fitzpatrick 3d9421a8e5 test: shorten goroutine-heavy test in race mode
The go race detector has a limit on how many goroutines it can track.
This test is only barely acceptable and the presence of any new
goroutines push it over the edge. Shorten this test is race mode.
2016-02-10 21:30:19 +00:00
iamqizhao 6079240b2c remove fail_on_leak flag 2016-02-08 14:50:27 -08:00
iamqizhao 77ccaa8fb2 Close ServerTransport instead of the raw connection 2016-02-08 14:27:06 -08:00
Brad Fitzpatrick fc0c458b89 Fix test-only goroutine leaks; add leak checker to end2end tests.
Some leaks remain, so this is disabled for now.

Updates grpc/grpc-go#528
2016-02-08 15:03:15 +00:00
Qi Zhao a0f854fec2 Merge pull request #515 from bradfitz/fatalf
Don't call t.FailNow in goroutines started by tests.
2016-02-01 12:50:34 -08:00
Brad Fitzpatrick 8024a575aa Don't call t.FailNow in goroutines started by tests.
The docs at https://golang.org/pkg/testing/#T.FailNow say:

> FailNow must be called from the goroutine running the test or
> benchmark function, not from other goroutines created during the
> test.

(Fatalf is documented as "Fatalf is equivalent to Logf followed by
FailNow.")

This was manifesting itself as a race with two concurrently failing
goroutines in my other CL, masking whatever the real problem was.
2016-02-01 19:15:37 +00:00
iamqizhao af8888dc8d remove Compressor/DecompressorGenerator 2016-01-29 14:38:20 -08:00
iamqizhao 6d87263bd5 add test 2016-01-27 18:34:24 -08:00
iamqizhao 61d7c39d4c comments and gofmt 2016-01-25 11:18:41 -08:00
iamqizhao da3bb0c9f7 Support compression 2016-01-22 18:21:41 -08:00
iamqizhao 6ef6ed778a test peer addr 2016-01-06 19:04:19 -08:00
iamqizhao b36c5c6fd9 Expose peer info 2016-01-06 18:20:01 -08:00
iamqizhao a98f0170cf fix some print format errors 2015-12-16 11:36:52 -08:00
iamqizhao 330d8f958c i) revise picker API and channel state API; ii) add unicastNamingPicker which supports custom name resolving. 2015-12-14 14:32:43 -08:00
iamqizhao cb8841c36e move some tests from end2end.go to clientconn_test.go 2015-11-06 11:33:13 -08:00
iamqizhao afca514667 Improve rpc cancellation when there is no pending I/O 2015-10-22 13:07:13 -07:00