3081 Commits

Author SHA1 Message Date
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
aad0edeefb health: shutdown server to set NOT_SERVING and disallow future updates (#2513) 2018-12-10 14:17:43 -08:00
e242249c0e comment typo: MaxConnectionAgeGrace(#2515) 2018-12-09 23:18:17 -08:00
4be7750b61 plumb lastConn error in v1 balancer (#2508) 2018-12-07 09:12:49 -08:00
187e357ac1 examples: multiplex (#2477) 2018-12-06 14:02:16 -08:00
49616eb1a1 examples: add echo proto (#2505) 2018-12-06 10:40:29 -08:00
272e9d4fbd Change version to 1.18.0-dev (#2498) 2018-12-04 16:43:20 -08:00
ca62c6b92c channelz: fix GetSecurityValue function name. (#2450) 2018-11-30 06:01:10 +08:00
55ef601361 internal: cleanup remaining x/net/context (#2470) 2018-11-28 12:46:35 -08:00
f3eb5bc06e client: add GRPC_GO_REQUIRE_HANDSHAKE options to control connection behavior (#2464)
Possible settings of this environment variable:

- "hybrid" (default; removed after the 1.17 release): do not wait for handshake before considering a connection ready, but wait before considering successful.

- "on" (default after the 1.17 release): wait for handshake before considering a connection ready/successful.

- "off": do not wait for handshake before considering a connection ready/successful.

This setting will be completely removed after the 1.18 release, and "on" will be the only supported behavior.
2018-11-26 15:06:46 -08:00
ef2b8e2f53 internal: move syscall.Conn wrapper into a separate package (#2457)
Also skip wrapping if `rawConn` doesn't implement `syscall.Conn`.
2018-11-15 13:29:39 -08:00
0fccf8bf59 transport: increase BDP limit to 16MB to improve performance for high latency networks (#2455) 2018-11-13 16:12:37 -08:00