2792 Commits

Author SHA1 Message Date
ec9c18c8c6 internal: split StateRecordingBalancer in test to balancer and builder (#2578)
And instead of setting state notify channel in balancer, create a new notify
channel at Build.

fixes #2576
2019-01-18 10:21:46 -08:00
9f93218b13 cleanup: update staticcheck to version supporting modules and new checkers (#2583) 2019-01-17 16:27:42 -08:00
d7e8e3da0d cleanup: remove staticcheck exception (#2582) 2019-01-17 10:24:42 -08:00
9572bbe0f9 cleanup: remove unused symbols (#2581) 2019-01-17 10:14:45 -08:00
efaac52355 roundrobin: randomize starting address when rebuilding the picker (#2579) 2019-01-17 09:17:03 -08:00
59acad4c45 cleanup: more simplifications (#2574) 2019-01-16 13:07:56 -08:00
4e92c060da cleanup: replace unnecessary loops (#2573) 2019-01-16 13:06:58 -08:00
dfd7708d35 cleanup: use time.Until(t) instead of t.Sub(time.Now) (#2571) 2019-01-15 16:09:50 -08:00
38b35dcb7c cleanup: lower-case starting character of error strings (#2572) 2019-01-15 16:09:35 -08:00
a1ead1ef6c Change version to 1.19.0-dev (#2569) 2019-01-15 13:34:07 -08:00
6cc789b34b client: make handshake required 'on' by default, not 'hybrid' (#2565) 2019-01-15 09:19:32 -08:00
98a94b0cb0 test: disable leakcheck after the first failure (#2563) 2019-01-14 15:40:20 -08:00
f647b6facb grpctest: defer Teardown to guarantee it is run even after t.Fatal (#2562) 2019-01-14 15:22:43 -08:00
9e7c146356 Return nil trailer metadata, if the RPC's status is context canceled. (#2554)
* Closes the client transport stream, if context is cancelled while recvBuffer is reading.

* Passes a function pointer to recvBufferReader, instead of a Stream and an http2Client.

* Adds more descriptive error messages.

* If waitOnHeader notices the context cancelation, shouldRetry no longer returns a ContextError. Instead, it returns the error from the last try.

* Makes sure that test gets both statuses at least 5 times.

* Makse cntPermDenied a lambda function.
2019-01-14 10:59:44 -08:00
954fe27324 benchmark: Unconstrained streaming benchmark (#2512)
* Adds unconstrained streaming benchmarks.
* Adds throughput to all scenarios.
* Adds comment to exported function.
* Adds comment to the new rpc.
* Adds a new run mode for unconstrained benchmarks.
* Converts counters to uint64s.
* Decreases default warm up time.
* Addresses PR comments.
* Deletes an unnecessary select/case
* Explains the use of RecvMsg rather than Recv.
2019-01-11 17:37:31 -08:00
bd0b3b2aa2 grpctest: fix comments to be more readable (#2555) 2019-01-09 15:32:22 -08:00
253dfbcf7d internal: use -go option to target 1.9 (#2550)
Staticcheck has a -go option which I _believe_ was recently added. This allows
us to pin to 1.9, preventing staticcheck from recommending we optimize to an
overly-recent version of Go.
2019-01-09 15:26:59 -08:00
b6f0a0f3fc grpctest: add example to show how it is used (#2552) 2019-01-09 12:52:40 -08:00
8fd063a5aa channelz: Implement GetServer method for channelz (#2537) 2019-01-09 10:50:34 -08:00
76cc50721c internal: rewrite TestDialWithMultipleBackendsNotSendingServerPreface (#2438)
- Remove the slice of servers approach, since there's specific
logic at server 2 that's different from server 1. This has the
advantage of making the test more readable without sacrificing
anything (given the previous point).

- Defer server close at initialization time instead of at the
end.

- Remove a time.Sleep(time.Second): use timeout + select around
serverDone instead.

- Use a goroutine to keep the connection reading, instead of
using a for loop in the server goroutine. This causes the
defer close(server2Done) to happen immediately after preface
is sent, which combined with the aforementioned time.Sleep
removal causes the test to go from 1.00s to ~0.05s.
2019-01-08 16:48:09 -08:00
0a391ff2b7 grpctest: add new package to manage tests and support per-test setup/teardown (#2523)
- Migrate `grpc` & `grpc/test` packages to use `Teardown` support to guarantee `leakcheck` is used
2019-01-07 14:24:56 -08:00
e441557ee9 rpc_util: update deprecated messages (#2545)
The status package now has `Convert()` and `Code()` utilities.

This patch updates the deprecation description for `ErrorDesc()` and
`Code()` to recommend using those functions, and forward the deprecated
functions to use the `status.Code()` and `status.Convert()` functions.
2019-01-07 13:45:27 -08:00
98de7e24ac internal: change split2() comment to be consistent with behavior (#2547) 2019-01-07 10:14:06 -08:00
c71aa62423 example: interceptor (#2541)
fix #2483
2019-01-02 10:33:06 -08:00
36f3126920 example: name_resolving (#2514) 2018-12-27 14:30:17 -08:00
2197c7b0de example: load_balancing (#2504) 2018-12-27 14:29:52 -08:00
0a3dc64b95 example: debugging (#2536)
fixes #2491
2018-12-27 14:03:13 -08:00
3961168004 enhance log for hello world SayHello (#2538)
This PR adds a log to `SayHello`. This makes server logic more clear.
2018-12-27 12:40:13 -08:00
7b14136291 health: resume health server (#2528) 2018-12-26 10:44:53 -08:00
25de51fc02 example: errors (#2534)
* Adds readme.

* Fills readme.

* Adds readme.

* Moves error examples.

* Adds port flag.

* Changes the flag for clients.

* Adds package comments.
2018-12-21 16:55:49 -08:00
f286604fb2 example: cancellation (#2525) 2018-12-21 15:45:49 -08:00
2cb2074db0 example: authentication (#2531) 2018-12-21 14:43:20 -08:00
adac1aeabd example: compression (#2527) 2018-12-21 13:55:59 -08:00
30155c0ba1 example: errors (#2521)
* Adds readme.

* Fills readme.

* Adds readme.
2018-12-20 17:55:12 -08:00
1838dedee3 channelz: respect max_results in listing methods (#2516) 2018-12-20 13:53:39 -08:00
463950a151 internal: example flag.Parse() and comments (#2526) 2018-12-20 12:43:38 -08:00
d9bc55b745 example: encryption (#2524)
fixes #2487
2018-12-19 16:45:46 -08:00
1b41b79fd1 internal: refactor transport to single retry mechanism (#2461)
Previously, the transport was able to reset via the retry loop,
or via the event closures calling resetTransport. This meant
a very large amount of synchronization was necessary: one
reset meant the other had to not reset; state had to be kept
at the addrconn; and very subtle interactions were hard to
reason about.

This change removes the ability for event closures to directly
reset the transport. Instead, they signal to to the retry
loop about the event, and the retry loop is always the single
place that retries occur.

This also allows us to refactor the address switching logic
into a much simpler for loop inside the retry loop instead of
using addrConn state to keep track of an index.
2018-12-17 13:10:13 -08:00
42df0c551e examples: deadline (#2494)
* Deadliner service

* Works.

* Uses helloworld.proto.

* Style fix

* Comments

* Uses Echo service and adds streaming example.

* Addresses the comments.

* Adds an error.

* Addresses PR comments.

* Removes port parameter from a function.
2018-12-14 15:36:21 -08:00
5da252b6a6 health check test: prevent double close of hcEnterChan (#2441) 2018-12-13 16:44:36 -08:00
b74673af89 examples: wait_for_ready (#2503)
* Working example.

* Uses echo server.

* Style fix.

* Changes client streaming implementation.

* Adds README.

* replaces the use of failfast with waitforready.

* Adds package comment.
2018-12-13 16:13:38 -08:00
29a7ac4deb client: deprecates FailFast & replaces its use by WaitForReady. 2018-12-13 15:15:11 -08:00
39333409e4 internal: copy testdata to routeguide (#2478)
So it's not necessary to set the testdata file as flag.

Without this, using relative directory, the example only works if run in `example/routeguide`.
2018-12-13 14:47:53 -08:00
9d925ce589 examples: metadata (#2500) 2018-12-13 14:45:14 -08:00
53884fa7e6 grpclb: re-resolve when the stream to GRPCLB balancer fails (#2502) 2018-12-13 14:44:34 -08:00
191cc8e37b grpclb: filter out grpclb addresses if balancer in use is not grpclb (#2509) 2018-12-13 10:54:42 -08:00
ebf41aabc9 roundrobin: use balancer.ConnectivityStateEvaluator in roundrobin (#2520)
This PR refactors `connectivityStateEvaluator` with `balancer.ConnectivityStateEvaluator`.
2018-12-12 17:08:09 -08:00
102aee9b32 internal: cleanup roundrobin_test with cleanup function (#2519)
This PR refactor the code with a simple cleanup function.
2018-12-12 17:06:06 -08:00
14de8b69c2 WithWaitForHandshake: fix deprecated comment (#2518) 2018-12-10 17:17:24 -08:00
a3af876a09 internal: document example/echo proto (#2517) 2018-12-10 14:56:32 -08:00