Commit Graph

29 Commits

Author SHA1 Message Date
mmukhi 7a8c989507
Less mem (#1987)
* Export changes to OSS.

* First commit.

* Cherry-pick.

* Documentation.

* Post review updates.
2018-04-30 09:54:33 -07:00
Jean de Klerk 4b17696981 internal: clean up deprecated Invoke() usage (#1966) 2018-04-05 14:09:56 -07:00
dfawley f4b523765c
status: add Code convenience function (#1754) 2017-12-18 15:00:50 -08:00
Daniel Nephin 4e393e0b21 grpc: fix deprecation comments to conform to standard (#1691) 2017-12-18 09:23:42 -08:00
Menghan Li 4bbdf230d7 New implementation of roundrobin and pickfirst (#1506) 2017-10-02 09:22:57 -07:00
Menghan Li d46a3655c4 Add leak goroutine checking to grpc/balancer tests (#1497) 2017-09-07 14:30:05 -07:00
ZhouyihaiDing 01089b2972 Remove buf copy when the compressor exist (#1427) 2017-08-25 12:26:38 -07:00
Jan Tattermusch ddbf6c46a6 autofix license notice 2017-06-08 14:42:19 +02:00
dfawley 1d27587e10 Change status package to deal with concrete types instead of interfaces (#1171) 2017-04-06 11:41:07 -07:00
dfawley 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
Menghan Li 6445dedfbc fix wrong context when handling stats 2016-11-08 18:17:14 -08:00
Menghan Li 17ee5a3637 Add package stats, and export stats on server side. 2016-11-07 15:16:52 -08:00
iamqizhao b85d2b0be5 Support transport tap 2016-11-03 14:21:24 -07:00
Menghan Li f3ac95e6cd Check if cc.conns == nil before reading cc.conns 2016-08-18 16:43:58 -07:00
iamqizhao b13920a0cf add the mem alloc guard on server 2016-07-29 16:19:20 -07:00
Daniel Ruehle 3802318f46 Make Errorf return pointer to rpcError 2016-07-08 10:28:36 -07:00
iamqizhao aa532d5baf Fix some issues and remove garbbage files 2016-05-16 15:31:00 -07:00
iamqizhao a1b60d7b43 Add the tests for balancer and resolver 2016-05-12 17:01:58 -07:00
Anthony Romano 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
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
Victor Vieux 047af78181 fix a few typos 2016-03-16 16:40:16 -07: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
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
Brad Fitzpatrick 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
iamqizhao da3bb0c9f7 Support compression 2016-01-22 18:21:41 -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 900db87189 Allow >16k status desc 2015-11-18 16:22:08 -08:00
iamqizhao f53fd361b7 initial call_test.go 2015-11-18 11:56:15 -08:00
iamqizhao 586ba13085 initial call_test.go 2015-11-18 11:34:37 -08:00