2349 Commits

Author SHA1 Message Date
9bf8ea0a82 clientconn, server: replace time.After with time.NewTimer (#998)
When timeout is not hit `time.After` will leak unnecessary timer, so
it's better to stop timer explicitly.

Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
2017-05-19 15:57:10 -07:00
c7379be7b6 grpclb balancer.Close() should not panic if called more than once (#1250) 2017-05-19 15:44:37 -07:00
27ae1472a3 remove some todo comments 2017-05-19 14:55:35 -07:00
074dbfbc52 Add doc and example for mocking streaming RPCs (#1230)
* Example code for mocking streams
* Added another expectation on the stream
* Documentation for mocking streaming RPCs
2017-05-19 13:36:45 -07:00
ed64d51c18 remove unnecessary ok 2017-05-19 11:52:09 -07:00
d19bbe846e change max message size functions name 2017-05-19 11:08:40 -07:00
504db8e582 merge master 2017-05-18 14:52:35 -07:00
11d93ecdb9 Test for EmptyCallOption 2017-05-17 14:47:38 -07:00
ce595b8452 Implement EmptyCallOption 2017-05-17 14:47:38 -07:00
3419b42955 Reuse Token for serviceAccount credentials (#1238) 2017-05-16 12:37:36 -07:00
3773797869 Travis: add staticcheck (#1019)
Also only run golint and go vet in Go 1.8, and fix some vet failures.
2017-05-15 17:05:27 -07:00
7505481848 comments added 2017-05-15 15:13:53 -07:00
4d2b4b5c51 fix minor typo 2017-05-15 14:36:20 -07:00
e2f22b027b Defined GA and add pointer to benchmarks (#1239) 2017-05-15 14:12:16 -07:00
35d77ea991 merge master, resolve conflicts 2017-05-15 13:54:22 -07:00
bdf9a640e4 add timeout test, add check or pointer filed in callOption, fix minor issues 2017-05-15 13:51:11 -07:00
aacd01c219 call listen with "localhost:port" instead of ":port" in tests (#1237) 2017-05-15 12:43:49 -07:00
135247d85c fix server panic trying to send on stream as client disconnects #1111 (#1115) 2017-05-15 12:41:55 -07:00
1c69e4cae0 Eagerly set a pointer to nil to help GC (#1232) 2017-05-12 14:06:10 -07:00
780308da60 add logs to grpclb on send and recv (#1235) 2017-05-12 14:05:32 -07:00
a0c3e72252 Add stats test for client streaming and server streaming RPCs (#1140) 2017-05-11 11:58:13 -07:00
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
07bd9434fa Pass custom dialer to balancer (#1205)
* Pass custom dialer to balancer
* add test for passing custom dialer
* add grpclb package comment
2017-05-11 10:10:19 -07:00
3dd14ccc71 Http status to grpc status conversion (#1195) 2017-05-11 09:40:46 -07:00
17760cfd5b Calling handleRPC with context derived from the original (#1227)
* Calling handleRPC with different context derived from the original context
* change comment for tagRPC and stats fields
2017-05-10 17:54:49 -07:00
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
4013f8d559 tentative fix to a flow control over-give-back bug (#1170) 2017-05-10 10:55:38 -07:00
59426b3c05 gofmt 2017-05-08 00:22:57 +00:00
d9265441de remove unessary nil in return statement 2017-05-08 00:17:01 +00:00
3ea287058c Merge branch 'master' into service_config_pr 2017-05-07 16:49:32 -07:00
ffa4ec7da2 Ensure that RoundRobin.Close() does not panic. (#1139) 2017-05-05 13:59:00 -07:00
2eb11e102d Log the actual error when inTapHandle fails in http2Server (#1185) 2017-05-05 13:40:31 -07:00
66a9140c20 make ServerOption panic messages more clear. (#1194)
ServerOption panics when fields that have been manually set are
subsequently set again.  The message verbiage of `X has been set` is
unclear since `has been set` without an adverb like `already` does not
correctly convey that the fields are set-once and were previously set.
At the worst, the original verbiage `X has been set` could imply that
the new value would have been acceptable but another error occurred.

We discovered this while conducting a code survey for implementing
extensible stubs and uniform inbound interception API.
2017-05-05 13:31:10 -07:00
f3b5bf53ce Make window size configurable. (#1210)
* Make window size configurable.
2017-05-05 13:26:56 -07:00
07f4e6bf4e Reset proto before unmarshalling (#1222) 2017-05-05 13:23:47 -07:00
844f573616 Merge pull request #1221 from adelez/doc_fixit
Fix doc
2017-05-04 16:41:58 -07:00
a40b8d44e0 Address the comments 2017-05-04 16:29:17 -07:00
7ddf89f9b7 Fix doc 2017-05-04 10:30:28 -07:00
68a5d50f45 Fix go buildable source file problem (#1213) 2017-05-02 15:55:05 -07:00
0914b46180 don't add defer func if stats handler is nil (#1214) 2017-05-02 10:16:45 -07:00
0eb507a2ca Change version to 1.4.0-dev (#1212) 2017-04-28 15:32:14 -07:00
84cd50a2f3 Fix nil pointer dereferences from status.FromProto(nil) (#1211) 2017-04-28 14:28:53 -07:00
fc5d355228 Split grpclb client load report test to deflake test. (#1206) 2017-04-28 12:06:45 -07:00
4d1604cc04 Use unpadded base64 encoding for binary metadata headers; handle padded or unpadded input (#1209) 2017-04-28 11:32:27 -07:00
b610ffd3f8 Never encode binary metadata within the metadata map (#1188)
This change ensures consistency for the user when accessing metadata values:
they are never encoded except when sent on the wire.  Previously, they would
appear encoded to client code, but not to server code.  As such, this
represents a behavior change, but one unlikely to affect user code, as it's
unusual to inspect the metadata after setting it.
2017-04-28 10:56:58 -07:00
277e90a432 Client load report for grpclb. (#1200) 2017-04-27 10:43:38 -07:00
a7fee9febf Use proto.Equal for equalities on Go proto messages (#1204) 2017-04-27 10:19:45 -07:00
ea230c713e update 2017-04-26 17:54:25 -07:00
ecbc34aaca move server defaults, delete defer cancel() in stream.go 2017-04-26 17:39:57 -07:00
eaa9ccb053 minor comment change 2017-04-26 16:23:24 -07:00