Commit Graph

1143 Commits

Author SHA1 Message Date
Xiang Li 11ef22ebfb make comment on invoke/sendmsg more clear 2016-04-01 10:47:25 -07:00
Qi Zhao 33966f5391 Merge pull request #602 from menghanl/metadata_doc
Add metadata documentation
2016-03-29 14:16:34 -07:00
Menghan Li 3187ce79ff Merge pull request #617 from iamqizhao/master
Added the unmapped http2 error and fixed a related bug in RST_STREAM …
2016-03-29 13:58:50 -07:00
iamqizhao 2f0d12ea11 Added the unmapped http2 error and fixed a related bug in RST_STREAM handling. 2016-03-29 11:07:22 -07:00
Menghan Li b60d4e72a1 Add metadata documentation 2016-03-29 11:00:44 -07:00
Qi Zhao d1f7152c46 Merge pull request #612 from peter-edge/makefile_updates
Update Makefile
2016-03-28 23:31:13 -07:00
Qi Zhao 877b524786 Merge pull request #588 from tamird/perf-less
transport: performance improvements
2016-03-28 23:30:09 -07:00
Qi Zhao 3c688e321a Merge pull request #611 from iamqizhao/master
Bump the required Go version
2016-03-28 23:15:44 -07:00
Qi Zhao 8e8c6a1b40 Merge pull request #604 from broady/travis
travis: build against go1.5.3, go1.6
2016-03-28 23:15:11 -07:00
Tamir Duberstein 54ac7579a7 transport: skip the backlog if it's empty
This provides a modest reduction in allocation count.

Benchmarked using https://github.com/cockroachdb/rpc-bench:

```
name                 old time/op    new time/op    delta
GRPCServeHTTP_1K-4      181µs ± 3%     178µs ± 2%    ~     (p=0.310 n=5+5)
GRPCServeHTTP_64K-4    1.31ms ± 4%    1.30ms ± 3%    ~     (p=0.548 n=5+5)

name                 old speed      new speed      delta
GRPCServeHTTP_1K-4   11.3MB/s ± 3%  11.5MB/s ± 2%    ~     (p=0.246 n=5+5)
GRPCServeHTTP_64K-4   100MB/s ± 4%   100MB/s ± 2%    ~     (p=0.548 n=5+5)

name                 old alloc/op   new alloc/op   delta
GRPCServeHTTP_1K-4     88.5kB ± 0%    88.5kB ± 0%  -0.09%  (p=0.008 n=5+5)
GRPCServeHTTP_64K-4     801kB ± 0%     801kB ± 0%  -0.05%  (p=0.008 n=5+5)

name                 old allocs/op  new allocs/op  delta
GRPCServeHTTP_1K-4        167 ± 0%       162 ± 0%  -2.99%  (p=0.008 n=5+5)
GRPCServeHTTP_64K-4       672 ± 0%       645 ± 0%  -4.08%  (p=0.008 n=5+5)
```
2016-03-28 21:26:36 -04:00
iamqizhao 58c3636a27 revise wording 2016-03-28 15:44:29 -07:00
Chris Broadfoot 785723ef9c travis: build against go1.5.3, go1.6 2016-03-28 15:06:19 -07:00
Peter Edge bc6951eb0b Update Makefile.
Signed-off-by: Peter Edge <peter.edge@gmail.com>
2016-03-29 00:05:04 +02:00
iamqizhao a6e9e042c5 Bump the required Go version 2016-03-28 15:02:37 -07:00
Qi Zhao 5309b8314a Merge pull request #608 from menghanl/better_http2_header_newline_error
Use ErrorDetail() to provide better error msg for malformed HTTP2
2016-03-28 13:17:04 -07:00
Menghan Li 71e3dbec56 Use ErrorDetail() to provide better error msg for malformed HTTP2 2016-03-28 11:34:29 -07:00
Qi Zhao 9e3a674ceb Merge pull request #599 from iamqizhao/master
lowercase credential keys
2016-03-22 14:41:09 -07:00
iamqizhao e5f60381dd lowercase credential keys 2016-03-22 11:33:19 -07:00
Qi Zhao 2dc70c28da Merge pull request #596 from enisoc/errorf
Don't treat StatusDesc() as a format string.
2016-03-22 11:11:59 -07:00
Qi Zhao 896247136f Merge pull request #598 from iamqizhao/master
Specialize http2.StreamError when the server reads frames
2016-03-22 11:07:08 -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
Anthony Yeh a294a45ba0 Don't treat StatusDesc() as a format string.
For example, if the error message contains "%v", then passing
StatusDesc() as the format string to Errorf() will replace "%v" with
"%!v(MISSING)".
2016-03-19 17:15:21 -07:00
Qi Zhao d3ddb4469d Merge pull request #595 from vieux/typos
fix a few typos
2016-03-17 10:50:43 -07:00
Victor Vieux 047af78181 fix a few typos 2016-03-16 16:40:16 -07:00
Qi Zhao 75cc451428 Merge pull request #593 from dsymonds/prbot-gofmt
gofmt everything
2016-03-16 10:40:56 -07:00
David Symonds a0594a1683 Run gofmt over Go source files. 2016-03-16 15:11:58 +11:00
Qi Zhao 986912c907 Merge pull request #590 from petermattis/pmattis/context-with-stream
transport: remove unnecessary allocation
2016-03-09 11:37:48 -08:00
Qi Zhao ef489cba5c Merge pull request #591 from petermattis/pmattis/buffered-reader
Use a bufio.Reader for input.
2016-03-09 11:35:03 -08:00
Peter Mattis a1d076a617 Use a bufio.Reader for input.
This reduces the number of system calls for reading network data,
providing a nice speedup when there are concurrent RPCs.
2016-03-09 12:07:58 -05:00
Peter Mattis 8b936e927a transport: remove unnecessary allocation
Storing an integer in an interface requires an allocation. Storing an
empty struct does not. This matches the pattern used for peer.NewContext
and metadata.NewContext.
2016-03-09 10:27:53 -05:00
Qi Zhao b1439a2743 Merge pull request #522 from dsymonds/master
Prepare for adding a compatibility marker to proto generated code.
2016-03-07 12:19:07 -08:00
David Symonds 710dbc764f Prepare for adding a compatibility marker to proto generated code.
This will assert at build time that the generated code is compatible
with the grpc package that it is linked to. A future change in the
grpc plugin for protoc-gen-go will generate a line like
	const _ = grpc.SupportPackageIsVersion1

This constant will be renamed in the future when incompatible changes
are made that require synchronised updates to grpc and protoc-gen-go.
2016-03-07 10:12:28 +11:00
Qi Zhao fea7689493 Merge pull request #584 from bradfitz/h2
Simplify server setup when testing the http.Handler-based server transport
2016-03-02 10:59:35 -08:00
Brad Fitzpatrick 18b2da6250 Simplify server setup when testing the http.Handler-based server transport
This simplifies the code that's used for wiring up the http.Handler-based
transport for testing. It's not used outside of tests.

http2.Server.ServeConn was added somewhat recently for other reasons and
I just realized it would simplify this code as well.
2016-03-02 18:49:23 +00:00
Qi Zhao 0e69ad1ebd Merge pull request #580 from iamqizhao/master
Fix err handling of malformed http2
2016-03-01 11:42:18 -08:00
iamqizhao f3c6dc545f Fix err handling of malformed http2
polish the commit
2016-03-01 10:52:13 -08: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
Qi Zhao b88c12e7ca Merge pull request #570 from bradfitz/meta
transport: use http2.Framer's MetaHeadersFrame functionality
2016-02-26 13:37:15 -08:00
Qi Zhao 7459645a33 Merge pull request #574 from iamqizhao/master
Skip all goroutines in C code for the leak detection
2016-02-26 10:49:11 -08:00
Qi Zhao b4adf7d359 Merge pull request #573 from bradfitz/no_cover
Disable the code coverage checker.
2016-02-25 18:35:59 -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
Qi Zhao 8a7d92a735 Merge pull request #572 from iamqizhao/master
Add more uninteresting goroutines for the leak detector
2016-02-25 16:09:25 -08:00
Brad Fitzpatrick 3ecc13ec96 Disable the code coverage checker.
It's too noisy and not worth it. I don't like encouraging the code
coverage game, wherein people write bad tests to get points.
It's annoying to get a red X in the PR status when coverage dropped
by 1 line or 0.4%.

Good code review should be sufficient to verify we have both tests
and good tests.
2016-02-26 00:02:08 +00:00
Brad Fitzpatrick ac5c8d7972 transport: use http2.Framer's MetaHeadersFrame functionality
The Framer now has support for merging HEADERS+CONTINUATION frames.
This remove the frame merging & hpack state machine from grpc.

In addition to being more compliant with the spec, this also means
gRPC enforces the header list size, removing a DoS vector.

Change-Id: Id46a6a1e741e62a859c3e3fb9f0cc36febf1d836
2016-02-25 23:44:45 +00: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