Commit Graph

210 Commits

Author SHA1 Message Date
lyuxuan 105f61423e
health: Client LB channel health checking (#2387) 2018-11-01 10:49:35 -07:00
Menghan Li 24638f5984
binarylog: call binary log in Client and Server (#2388)
Also includes:
 - Export `NewLoggerFromConfigString` so it can be also used when config string is specified in another way (e.g. command line flag)
 - Export `Logger` so user can install custom sink
 - Add temp file sink implementation
2018-10-31 10:21:20 -07:00
Menghan Li 0361d80ffd
server: reuse function recv() in processUnary (#2351)
This change splits recv() into two functions so it can be used by processUnary.
2018-10-08 13:55:04 -07:00
Jelte Fennema f2aaa9bf74 Check error when calling compressor.Compress (#2274)
Compress can return an error, which was not checked.
2018-09-14 08:57:13 -07:00
dfawley 5fe10fccaf
Remove unused symbols (#2287) 2018-09-05 12:29:02 -07:00
lyuxuan f4da7eee53
channelz: use atomic instead of mutex (#2218) 2018-08-06 11:17:12 -07:00
dfawley 339b6cb107
transport: eliminate StreamError; use status errors instead (#2239) 2018-07-26 10:30:58 -07:00
dfawley 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
dfawley 40a879c23a
client: Implement gRFC A6: configurable client-side retry support (#2111) 2018-06-27 16:18:41 -07:00
Menghan Li b4dd78522b
internal: move version to a separate file (#2080)
So it's easier to update version when doing releases.
2018-05-16 10:32:41 -07:00
dfawley 091a800143
split encode into three functions (#2058) 2018-05-11 13:47:10 -07:00
lyuxuan 45d7f3a23f
Change version to 1.13.0-dev (#2054) 2018-05-08 14:17:26 -07:00
mmukhi 0bc7c3280e
Revert "Less mem (#1987)" (#2049)
This reverts commit 7a8c989507.
2018-05-03 11:37:59 -07:00
mmukhi 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
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
Karsten Weiss 7de9139327 Fix typos (#1994) 2018-04-16 10:03:02 -07:00
Karsten Weiss 95bbf69653 Remove redundant return statements (gosimple)
This fixes:
balancer/base/balancer.go:149:2: redundant return statement (S1023)
balancer_v1_wrapper.go:260:2: redundant return statement (S1023)
balancer_v1_wrapper.go:273:2: redundant return statement (S1023)
balancer_v1_wrapper.go:285:2: redundant return statement (S1023)
benchmark/benchmark.go:68:2: redundant return statement (S1023)
clientconn.go:1461:2: redundant return statement (S1023)
grpclb.go:223:2: redundant return statement (S1023)
grpclb.go:260:2: redundant return statement (S1023)
grpclb_util.go:201:2: redundant return statement (S1023)
rpc_util.go:278:50: redundant return statement (S1023)
rpc_util.go:296:56: redundant return statement (S1023)
rpc_util.go:314:56: redundant return statement (S1023)
rpc_util.go:333:53: redundant return statement (S1023)
rpc_util.go:354:52: redundant return statement (S1023)
rpc_util.go:387:56: redundant return statement (S1023)
rpc_util.go:416:53: redundant return statement (S1023)
stream.go:651:2: redundant return statement (S1023)
2018-04-15 12:43:34 +02:00
Menghan Li 858463ac27
documentation: mention peer will only be populated after RPC completes (#1982) 2018-04-10 15:56:38 -07:00
Sam Batschelet 7316918402 clientconn: add support for unix network in DialContext. (#1883) 2018-04-09 11:12:34 -07:00
Menghan Li 30fb59a430 documentation: Mark compresser and decompresser as deprecated (#1971) 2018-04-06 11:05:14 -07:00
Menghan Li f72b28a6d1
Change version to 1.12.0-dev (#1946) 2018-03-27 15:15:31 -07:00
yogeshpandey 2249df6df9 gzip: Add ability to set compression level (#1891) 2018-03-20 11:57:00 -07:00
lyuxuan 738eb6b62f
fix minor typos and remove grpc.Codec related code in TestInterceptorCanAccessCallOptions (#1929) 2018-03-19 14:19:42 -07:00
Joshua Humphries fa28bef939 client: export types implementing CallOptions for access by interceptors (#1902) 2018-03-16 15:57:34 -07:00
dfawley 13975c0702
stream: split per-attempt data from clientStream (#1900)
This is pre-work to implementing retry support. Each retry attempt will have its own csAttempt. The fields left in clientStream are the same across all attempts.
2018-03-12 13:27:54 -07:00
Menghan Li dfa18343df
Change version to 1.11.0-dev (#1863) 2018-02-15 15:27:11 -08:00
dfawley 5ba054bf37
encoding: Introduce new method for registering and choosing codecs (#1813) 2018-01-23 11:39:40 -08:00
Ewan Chou c998149a22 Avoid copying headers/trailers in unary RPCs unless requested by CallOptions (#1775)
CPU profile shows that header copy takes a large proportion of CPU usage in a gRPC Call.
If the header is not needed, we don't need to pay the cost.
2018-01-03 09:13:06 -08:00
dfawley 82462103d1
Update version to 1.10.0-dev (#1777) 2018-01-02 16:35:01 -08:00
Daniel Nephin 4e393e0b21 grpc: fix deprecation comments to conform to standard (#1691) 2017-12-18 09:23:42 -08:00
Menghan Li 2ef021f78d
New grpclb implementation (#1558)
The new grpclb supports fallback to backends if remote balancer is unavailable
2017-11-27 11:16:26 -08:00
Menghan Li 646f701c82
Change version to 1.9.0-dev (#1682) 2017-11-22 10:46:06 -08:00
dfawley 816fa5b06f
Add proper support for 'identity' encoding type (#1664) 2017-11-17 09:24:54 -08:00
dfawley 8ff8683602
Implement transparent retries for gRFC A6 (#1597) 2017-11-06 13:45:11 -08:00
Zhouyihai Ding 5db344a40a Introduce new Compressor/Decompressor API (#1428) 2017-10-31 10:21:13 -07:00
lyuxuan fe0602d9d8 fix max msg size type issues on different arch (#1623) 2017-10-26 13:30:15 -07:00
dfawley c5f391bd6c Revert "cap max msg size to min(max_int, max_uint32) (#1598)" (#1619)
This reverts commit 5856538706.
2017-10-25 10:31:00 -07:00
lyuxuan 5856538706 cap max msg size to min(max_int, max_uint32) (#1598) 2017-10-24 10:20:54 -07:00
dfawley a5986a5c88 Add functions to ClientConn so it satisfies an interface for generated code (#1599) 2017-10-20 14:21:31 -07:00
dfawley 5c3d956e18 Re-add support for Go1.6 (#1603) 2017-10-20 12:05:20 -07:00
lyuxuan 6f3b6ff46b Parse ServiceConfig JSON string (#1515) 2017-10-19 12:09:19 -07:00
dfawley 16c41925b8 update fail fast documentation to remove retry language (#1586) 2017-10-17 14:35:11 -07:00
Menghan Li 90947a8e84 Change version to 1.8.0-dev (#1573) 2017-10-11 11:03:49 -07:00
dfawley c8405557a4 Remove Go1.6 support (#1492) 2017-10-04 13:57:10 -07:00
Menghan Li 59cb69e66d Fix misspells (#1531) 2017-09-20 14:55:57 -07:00
Menghan Li 8233e124e4 Add new Resolver and Balancer APIs (gRFC L9) (#1408)
- Add package balancer and resolver.
 - Change ClientConn internals to new APIs and adds a wrapper for v1 balancer.
2017-08-31 10:59:09 -07:00
Menghan Li 3a378f9deb Change version to 1.7.0-dev (#1496) 2017-08-30 13:32:29 -07:00
dfawley 2b9fb51017 Fix for 32-bit architectures (#1471) 2017-08-25 15:09:36 -07:00
ZhouyihaiDing 01089b2972 Remove buf copy when the compressor exist (#1427) 2017-08-25 12:26:38 -07:00
Zeymo 1308414496 put *gzip.Writer back to pool (#1441) 2017-08-14 15:23:10 -07:00
Menghan Li 2b21bfb96b Change version to 1.6.x (#1382) 2017-07-20 13:19:54 -07:00
Mehrdad Afshari 93166a0b0b Canonicalize https://grpc.io as the preferred URL prefix 2017-07-10 16:28:39 -07:00
Menghan Li 1d797552ae Add support for grpc.SupportPackageIsVersion3 back (#1331)
* Support byte slice file descriptor as metadata and add SupportPackageIsVersion3 back

* add v3 test, generate testv3.pb.go with old codegen
2017-06-22 13:56:59 -07:00
Jan Tattermusch ddbf6c46a6 autofix license notice 2017-06-08 14:42:19 +02:00
Menghan Li 06c984861f Change version to 1.5.0-dev (#1288) 2017-06-07 15:15:26 -07:00
MakMukhi 6fecf2831a Reopening: Server shouldn't Fatalf in case it fails to encode. (#1276)
* Server shouldn't Fatalf in case it fails to encode.
2017-06-02 12:32:37 -07:00
MakMukhi 843116533a Revert "Server shouldn't Fatalf in case it fails to encode. (#1251)" (#1274)
This reverts commit d5bc85c1e9.
2017-06-01 12:34:28 -07:00
MakMukhi d5bc85c1e9 Server shouldn't Fatalf in case it fails to encode. (#1251)
* Server shouldn't Fatalf in case it fails to encode.

* golint

* post-review update
2017-06-01 11:57:45 -07:00
dfawley 3a46d9d519 Avoid panic caused by stdlib context package errors (#1258) 2017-05-24 16:01:38 -07:00
MakMukhi 6dff7c5f33 Expand stream's flow control in case of an active read. (#1248)
* First commit

* Imported tests from the original PR by @apolcyn.

* Formatting fixes.

* More formating fixes

* more golint

* Make logs more informative.

* post-review update

* Added test to check flow control accounts after sending large messages.

* post-review update

* Empty commit to kickstart travis.

* Post-review update.
2017-05-23 11:39:15 -07:00
Yuxuan Li cb64938381 fix minor issues 2017-05-19 16:02:02 -07:00
Yuxuan Li d19bbe846e change max message size functions name 2017-05-19 11:08:40 -07:00
Yuxuan Li 504db8e582 merge master 2017-05-18 14:52:35 -07:00
Mehrdad Afshari ce595b8452 Implement `EmptyCallOption` 2017-05-17 14:47:38 -07:00
Yuxuan Li 35d77ea991 merge master, resolve conflicts 2017-05-15 13:54:22 -07:00
Yuxuan Li bdf9a640e4 add timeout test, add check or pointer filed in callOption, fix minor issues 2017-05-15 13:51:11 -07:00
MakMukhi 88a73d35c9 Adding dial options for PerRPCCredentials (#1225)
* Adding dial options for PerRPCCredentials

* Added tests for PerRPCCredentials

* Post-review updates

* post-review updates
2017-05-11 11:07:38 -07:00
Steeve Morin 600406e696 Use pooled gzip.{Writer,Reader} in gzip{Compressor,Decompressor} (#1217)
This change saves a lot of memory by reusing the underlying
gzip.{Writer,Reader}, which allocates up to 1.4mb at every instanciation
according to [1]. This was fixed by adding a Reset method by to the
object at [2].

The amount of memory (and GC time) saved is pretty high, as reported by
pprof:

      flat  flat%   sum%        cum   cum%
   28.33GB 85.70% 85.70%    32.74GB 99.05%  compress/flate.NewWriter

      flat  flat%   sum%        cum   cum%
   19.39MB 16.74% 16.74%    22.07MB 19.05%  compress/flate.NewWriter

And the benchmarks:

benchmark                           old ns/op     new ns/op     delta
BenchmarkGZIPCompressor1B-4         215170        22291         -89.64%
BenchmarkGZIPCompressor1KiB-4       225971        27213         -87.96%
BenchmarkGZIPCompressor8KiB-4       246696        54785         -77.79%
BenchmarkGZIPCompressor64KiB-4      444851        286924        -35.50%
BenchmarkGZIPCompressor512KiB-4     2279043       2115863       -7.16%
BenchmarkGZIPCompressor1MiB-4       4412989       4258635       -3.50%

benchmark                           old allocs     new allocs     delta
BenchmarkGZIPCompressor1B-4         17             0              -100.00%
BenchmarkGZIPCompressor1KiB-4       17             0              -100.00%
BenchmarkGZIPCompressor8KiB-4       17             0              -100.00%
BenchmarkGZIPCompressor64KiB-4      17             0              -100.00%
BenchmarkGZIPCompressor512KiB-4     17             0              -100.00%
BenchmarkGZIPCompressor1MiB-4       17             0              -100.00%

benchmark                           old bytes     new bytes     delta
BenchmarkGZIPCompressor1B-4         813872        8             -100.00%
BenchmarkGZIPCompressor1KiB-4       813872        16            -100.00%
BenchmarkGZIPCompressor8KiB-4       813875        27            -100.00%
BenchmarkGZIPCompressor64KiB-4      813918        190           -99.98%
BenchmarkGZIPCompressor512KiB-4     814928        1871          -99.77%
BenchmarkGZIPCompressor1MiB-4       820889        9735          -98.81%

[1] https://github.com/golang/go/issues/6138
[2] db12f9d4e4

Signed-off-by: Steeve Morin <steeve.morin@gmail.com>
2017-05-10 16:40:25 -07:00
lyuxuan 3ea287058c Merge branch 'master' into service_config_pr 2017-05-07 16:49:32 -07:00
Adele Zhou a40b8d44e0 Address the comments 2017-05-04 16:29:17 -07:00
Menghan Li 0eb507a2ca Change version to 1.4.0-dev (#1212) 2017-04-28 15:32:14 -07:00
Menghan Li 277e90a432 Client load report for grpclb. (#1200) 2017-04-27 10:43:38 -07:00
Yuxuan Li ecbc34aaca move server defaults, delete defer cancel() in stream.go 2017-04-26 17:39:57 -07:00
Yuxuan Li eaa9ccb053 minor comment change 2017-04-26 16:23:24 -07:00
Yuxuan Li 9c5f260e67 make max size a pointer type and initialize function a CallOption 2017-04-26 15:50:58 -07:00
Yuxuan Li 983d8372ea update the merge of client api and sc 2017-04-21 16:18:59 -07:00
Yuxuan Li bab6b617b7 merge master 2017-04-21 16:07:34 -07:00
Menghan Li 955c867061 Support proxy with dialer (#1098)
With this change, the default dialer checks environment variables to see if proxy is needed. If so, it dials to the proxy and does an HTTP CONNECT handshake.
2017-04-17 16:08:50 -07:00
Yuxuan Li cb02ab4d25 change error message from InvalidArgument to ResourceExhausted 2017-04-13 16:51:56 -07:00
Yuxuan Li 8788b75675 merge master resolve conflicts 2017-04-13 16:28:15 -07:00
apolcyn 0e8b58d22f use proto.Buffer API for protobuf codec and cache proto.Buffer structs (#1010)
* use a global sharded pool of proto.Buffer caches in protoCodec

* fix goimports

* make global buffer pool index counter atomic

* hack to remove alloc in encode_len_struct

* remove extra slice alloc in proto codec marshal

* replce magic number for proto size field length with constant

* replace custom cache with sync.Pool

* remove 1 line functions in codec.go and add protoCodec microbenchmarks

* add concurrent usage test for protoCodec

* fix golint.gofmt,goimport checks

* fix issues in codec.go and codec_test.go

* use go parallel benchmark helpers

* replace proto.Codec with a guess of size needed

* update Fatalf -> Errorf in tests

* wrap proto.Buffer along with cached last size into larger struct for pool use

* make wrapped proto buffer only a literal

* fix style and imports

* move b.Run into inner function

* reverse micro benchmark op order to unmarshal-marshal and fix benchmark setup-in-test bug

* add test for large message

* remove use of defer in codec.marshal

* revert recent changes to codec bencmarks

* move sub-benchmarks into >= go-1.7 only file

* add commentfor marshaler and tweak benchmark subtests for easier usage

* move build tag for go1.7 on benchmarks to inside file

* move build tag to top of file

* comment Codec, embed proto.Buffer into cached struct and add an int32 cap
2017-04-12 20:35:59 -07:00
Yuxuan Li fa2968617c Merge branch 'master' into service_config_pr 2017-04-06 14:12:34 -07:00
Yuxuan Li 6f8b55318a fix the testMaxMsgSizeServerAPI failure 2017-04-06 14:08:04 -07:00
dfawley 1d27587e10 Change status package to deal with concrete types instead of interfaces (#1171) 2017-04-06 11:41:07 -07:00
lyuxuan f02290b023 Merge branch 'master' into service_config_pr 2017-04-05 11:15:55 -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
MakMukhi f45e6e3b30 Bug fix(Issue#1141): Check if peer is nil before trying to derefer it. (#1143) 2017-04-04 15:08:14 -07:00
Yuxuan Li 13b5f120b0 merge master 2017-04-03 15:20:13 -07:00
Yuxuan Li 50d4175072 Add client and service side apis for limiting the send/recv msg size. Update MethodConfig struct 2017-04-03 15:03:24 -07:00
Menghan Li 14a6be430b Add grpc.Version string and use it in the UA (#1144) 2017-03-24 11:29:02 -07:00
Tamir Duberstein 9871e09f09
Use codes.Code.String() rather than logging integers
This produces better human-readable error messages.
2017-02-27 14:13:02 -05:00
Yuxuan Li 6810d34606 fix issue #1056 and #1050 2017-02-13 17:37:53 -08:00
Mahak Mukhi dfb494c6e5 post review update 2017-02-08 14:15:59 -08:00
Mahak Mukhi 66de296a37 post review update 2017-02-07 14:46:28 -08:00
Mahak Mukhi 794873f0a2 Added calloption to retrieve peer information 2017-02-07 10:41:32 -08:00
Mark D. Roth 6e0ace39fe Change max message size fields from uint64 to uint32. 2017-01-26 14:43:08 -08:00
Mark D. Roth 325a0c2061 Update comment. 2017-01-09 12:59:10 -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
Menghan Li 3f9a96ea71 move inPayload.RecvTime to after unmarshal 2016-11-07 16:29:25 -08:00
Menghan Li 5938492b60 fix comments 2016-11-07 15:16:52 -08:00