34 Commits

Author SHA1 Message Date
11b582728a transport: move to internal to make room for new, public transport API (#2212)
This is a breaking change, but the transport package was never intended for use outside of grpc.  Any current users that we are aware of are incorrect or have a preferred alternative.
2018-07-11 11:22:45 -07:00
0e5a36b652 internal: move leakcheck to internal/ (#2129)
internal: move leakcheck to internal/
2018-06-07 16:57:56 -07:00
091a800143 split encode into three functions (#2058) 2018-05-11 13:47:10 -07:00
0bc7c3280e Revert "Less mem (#1987)" (#2049)
This reverts commit 7a8c9895074e03bc7fcff30bd561eaef4fa76dfa.
2018-05-03 11:37:59 -07:00
3592bccfd9 interop: Fix unimplemented method test (#2040)
* Don't send nil requests.

* Fix import name and get rid of condition.

* Let registered encoder deal with nil requests.

* Break encode into encode and compress.
2018-05-02 16:08:12 -07:00
7a8c989507 Less mem (#1987)
* Export changes to OSS.

* First commit.

* Cherry-pick.

* Documentation.

* Post review updates.
2018-04-30 09:54:33 -07:00
4b17696981 internal: clean up deprecated Invoke() usage (#1966) 2018-04-05 14:09:56 -07:00
f4b523765c status: add Code convenience function (#1754) 2017-12-18 15:00:50 -08:00
4e393e0b21 grpc: fix deprecation comments to conform to standard (#1691) 2017-12-18 09:23:42 -08:00
4bbdf230d7 New implementation of roundrobin and pickfirst (#1506) 2017-10-02 09:22:57 -07:00
d46a3655c4 Add leak goroutine checking to grpc/balancer tests (#1497) 2017-09-07 14:30:05 -07:00
01089b2972 Remove buf copy when the compressor exist (#1427) 2017-08-25 12:26:38 -07:00
ddbf6c46a6 autofix license notice 2017-06-08 14:42:19 +02:00
1d27587e10 Change status package to deal with concrete types instead of interfaces (#1171) 2017-04-06 11:41:07 -07:00
b507112439 Add status package for reporting gRPC status and errors (#1156)
When an error implemented by the status package is returned from a service
handler, the server will transmit a rich status message in the
"grpc-status-details-bin" trailing metadata field if any detailed data is
attached to the error.  Client-side, we will decode them if present in the
server's response and return them to the user code performing the RPC.

This is backward compatible with the existing errors supported by the grpc
package.  However, the grpc.Errorf, grpc.Code and grpc.ErrorDesc functions for
managing errors are now deprecated; status.Errorf and status.Status type
asserions should be used instead.
2017-04-05 10:35:40 -07:00
6445dedfbc fix wrong context when handling stats 2016-11-08 18:17:14 -08:00
17ee5a3637 Add package stats, and export stats on server side. 2016-11-07 15:16:52 -08:00
b85d2b0be5 Support transport tap 2016-11-03 14:21:24 -07:00
f3ac95e6cd Check if cc.conns == nil before reading cc.conns 2016-08-18 16:43:58 -07:00
b13920a0cf add the mem alloc guard on server 2016-07-29 16:19:20 -07:00
3802318f46 Make Errorf return pointer to rpcError 2016-07-08 10:28:36 -07:00
aa532d5baf Fix some issues and remove garbbage files 2016-05-16 15:31:00 -07:00
a1b60d7b43 Add the tests for balancer and resolver 2016-05-12 17:01:58 -07:00
025674fec5 transport: do not create a Stream on a canceled context
Occasionally Invoke() would let a message slip through when the context
is already canceled.
2016-04-12 21:45:35 -07:00
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
047af78181 fix a few typos 2016-03-16 16:40:16 -07:00
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
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
d52370625d Fix more cases of Fatalf being used from goroutines started by tests.
Follow-up to #515 based on comments there from @maniksurtani.
2016-02-01 21:01:14 +00:00
da3bb0c9f7 Support compression 2016-01-22 18:21:41 -08:00
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
900db87189 Allow >16k status desc 2015-11-18 16:22:08 -08:00
f53fd361b7 initial call_test.go 2015-11-18 11:56:15 -08:00
586ba13085 initial call_test.go 2015-11-18 11:34:37 -08:00