Commit Graph

2789 Commits

Author SHA1 Message Date
Doug Fawley 9572bbe0f9
cleanup: remove unused symbols (#2581) 2019-01-17 10:14:45 -08:00
Doug Fawley efaac52355
roundrobin: randomize starting address when rebuilding the picker (#2579) 2019-01-17 09:17:03 -08:00
Doug Fawley 59acad4c45
cleanup: more simplifications (#2574) 2019-01-16 13:07:56 -08:00
Doug Fawley 4e92c060da
cleanup: replace unnecessary loops (#2573) 2019-01-16 13:06:58 -08:00
Doug Fawley dfd7708d35
cleanup: use time.Until(t) instead of t.Sub(time.Now) (#2571) 2019-01-15 16:09:50 -08:00
Doug Fawley 38b35dcb7c
cleanup: lower-case starting character of error strings (#2572) 2019-01-15 16:09:35 -08:00
lyuxuan a1ead1ef6c
Change version to 1.19.0-dev (#2569) 2019-01-15 13:34:07 -08:00
Doug Fawley 6cc789b34b
client: make handshake required 'on' by default, not 'hybrid' (#2565) 2019-01-15 09:19:32 -08:00
Doug Fawley 98a94b0cb0
test: disable leakcheck after the first failure (#2563) 2019-01-14 15:40:20 -08:00
Doug Fawley f647b6facb
grpctest: defer Teardown to guarantee it is run even after t.Fatal (#2562) 2019-01-14 15:22:43 -08:00
Can Guler 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
Can Guler 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
Doug Fawley bd0b3b2aa2
grpctest: fix comments to be more readable (#2555) 2019-01-09 15:32:22 -08:00
Jean de Klerk 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
Doug Fawley b6f0a0f3fc
grpctest: add example to show how it is used (#2552) 2019-01-09 12:52:40 -08:00
Masahiro Sano 8fd063a5aa channelz: Implement GetServer method for channelz (#2537) 2019-01-09 10:50:34 -08:00
Jean de Klerk 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
Doug Fawley 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
Sebastiaan van Stijn 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
cheng wei 98de7e24ac internal: change split2() comment to be consistent with behavior (#2547) 2019-01-07 10:14:06 -08:00
lyuxuan c71aa62423
example: interceptor (#2541)
fix #2483
2019-01-02 10:33:06 -08:00
Menghan Li 36f3126920
example: name_resolving (#2514) 2018-12-27 14:30:17 -08:00
Menghan Li 2197c7b0de
example: load_balancing (#2504) 2018-12-27 14:29:52 -08:00
lyuxuan 0a3dc64b95
example: debugging (#2536)
fixes #2491
2018-12-27 14:03:13 -08:00
Ning Xie 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
Menghan Li 7b14136291
health: resume health server (#2528) 2018-12-26 10:44:53 -08:00
Can Guler 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
Doug Fawley f286604fb2 example: cancellation (#2525) 2018-12-21 15:45:49 -08:00
lyuxuan 2cb2074db0
example: authentication (#2531) 2018-12-21 14:43:20 -08:00
Doug Fawley adac1aeabd
example: compression (#2527) 2018-12-21 13:55:59 -08:00
Can Guler 30155c0ba1
example: errors (#2521)
* Adds readme.

* Fills readme.

* Adds readme.
2018-12-20 17:55:12 -08:00
Masahiro Sano 1838dedee3 channelz: respect max_results in listing methods (#2516) 2018-12-20 13:53:39 -08:00
Menghan Li 463950a151
internal: example flag.Parse() and comments (#2526) 2018-12-20 12:43:38 -08:00
lyuxuan d9bc55b745
example: encryption (#2524)
fixes #2487
2018-12-19 16:45:46 -08:00
Jean de Klerk 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
Can Guler 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
lyuxuan 5da252b6a6
health check test: prevent double close of hcEnterChan (#2441) 2018-12-13 16:44:36 -08:00
Can Guler 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
Can Guler 29a7ac4deb
client: deprecates FailFast & replaces its use by WaitForReady. 2018-12-13 15:15:11 -08:00
Menghan Li 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
Menghan Li 9d925ce589
examples: metadata (#2500) 2018-12-13 14:45:14 -08:00
Menghan Li 53884fa7e6
grpclb: re-resolve when the stream to GRPCLB balancer fails (#2502) 2018-12-13 14:44:34 -08:00
Menghan Li 191cc8e37b
grpclb: filter out grpclb addresses if balancer in use is not grpclb (#2509) 2018-12-13 10:54:42 -08:00
Ning Xie ebf41aabc9 roundrobin: use balancer.ConnectivityStateEvaluator in roundrobin (#2520)
This PR refactors `connectivityStateEvaluator` with `balancer.ConnectivityStateEvaluator`.
2018-12-12 17:08:09 -08:00
Ning Xie 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
lyuxuan 14de8b69c2
WithWaitForHandshake: fix deprecated comment (#2518) 2018-12-10 17:17:24 -08:00
Menghan Li a3af876a09
internal: document example/echo proto (#2517) 2018-12-10 14:56:32 -08:00
Menghan Li aad0edeefb
health: shutdown server to set NOT_SERVING and disallow future updates (#2513) 2018-12-10 14:17:43 -08:00
shaun e242249c0e comment typo: MaxConnectionAgeGrace(#2515) 2018-12-09 23:18:17 -08:00
Jean de Klerk 4be7750b61
plumb lastConn error in v1 balancer (#2508) 2018-12-07 09:12:49 -08:00