Commit Graph
400 Commits
Author SHA1 Message Date
dafea9adee fix(transport): return Poll::ready until error is consumed (#536)
* fix(transport): return Poll::ready until error is consumed

When a lazy connection fails to connect it first
returns Poll::ready from the reconnect service,
yet the subsequent call returns Poll::pending
making tower_balance loop forever.
Instead, on error we return Ready
until the error is consumed in the
call method.

* chore: revert version change

* refactor: Into<Error> bounds for error intead of debug

* Remove fmt::Debug bound for reconnect

Co-authored-by: Helge Hoff <[email protected]>
2021-01-15 12:34:41 -05:00
CameronandGitHub 31936e0513 feat(transport): add max http2 frame size to server. (#529)
* tonic: add max http2 frame size to server.

Exposes option to configure the max http2 frame size used by the
underlying hyper server via the `tonic::transport::Server` builder.

Refs: #264

* fix http2_* methods broken in merge conflict
2021-01-15 12:00:01 -05:00
Lucio FrancoandGitHub 41c51f1c61 feat(transport): Fix TLS accept w/ peer certs (#535)
* feat(transport): Fix TLS accept w/ peer certs

* fix unused var

* fix feature flag imports

* spawn accept task
2021-01-15 11:59:26 -05:00
Lucio FrancoandGitHub 4974604c0b ci: Disable deny workflow (#534) 2021-01-14 16:42:12 -05:00
fdda5ae26a Upgrade to Tokio 1.0.0 ecosystem (#530)
* Upgrade Tonic to Tokio 1.0

Work in progress for updating Tonic to Tokio 1.0. Since tower has not
been released to crates.io, a git dependency is taken instead.

* Upgrade Tonic to Tokio 1.0 phase 2

* tonic: remove tower-* deps

* Apply suggestions from code review

Co-authored-by: Ed Marshall <[email protected]>
Co-authored-by: Lucio Franco <[email protected]>
2021-01-11 12:18:34 -05:00
Alex PearsonandGitHub fe4d5b9d9a fix: gracefully handle bad native certs (#520)
Instead of failing and bailing when a bad cert is found, ignore one-off
errors for bad certs and continue to load the rest of the store.

These one-off errors mostly affect MacOS users, as found in this
rustls-native-certs issue: https://github.com/ctz/rustls-native-certs/issues/4

Fixes: #519
2021-01-07 10:52:13 -05:00
CameronandGitHub a6be8363ed Add h2 error conversion for Status (#509) 2021-01-05 16:04:15 -05:00
CameronandGitHub 6622bb1449 Update tonic logo (#508)
* Use fancy new logo

* Remove shell.nix
2021-01-05 16:03:33 -05:00
Hossein MayboudiandGitHub 9f1957f29d Add SERVICE_UNKNOWN to health.proto (#507)
There is a new field. https://github.com/grpc/grpc/blob/master/doc/health-checking.md
2021-01-05 16:02:59 -05:00
Hossein MayboudiandGitHub 6e5b16ce04 Update routeguide-tutorial.md (#505)
Update external link to async traits
2021-01-05 16:02:27 -05:00
Akhil VelagapudiandGitHub 76de87eec5 Remove unnecessary dependencies in tonic-health (#502)
* remove dependency on bytes

* remove dependency on async-stream
2021-01-05 16:02:13 -05:00
Akhil VelagapudiandGitHub 032302e9d0 don't format generated code in tonic-health (#501) 2021-01-05 16:01:45 -05:00
Julian PopescuandGitHub fc86563b36 feat(tonic): implement From<io::Error> for Status (#500)
Implements the conversion from `std::io::Error` to `tonic::Status`.

**Motivation:** The `io::Error` conversion is currently left as
unimplemented. It either should be implemented or removed if it won't be
implemented.

**Solution:** Implements the conversion from `std::io::Error` to
`tonic::Status`
2021-01-05 16:00:08 -05:00
Michael-J-WardandGitHub 3c2a4a2813 fixes routeguide tutorial URL to async book (#490) 2021-01-05 13:40:42 -05:00
Koki KatoandGitHub e7be352132 transport: impl Service for Channel instead of GrpcService (#482)
* transport: impl Service for Channel instead of GrpcService

This adds tower::Service impl for tonic::transport::Channel
and removes GrpcService impl declaration.

Channel still implements GrpcService, thanks to the general
impl declaration of GrpcService for types who implement Service.

Fixes #481.

* examples: stop using GrpcService to avoid ambiguity

* examples: add timeout example
2021-01-05 13:36:18 -05:00
Pedro CaladoandGitHub 2b9cdb9779 feat(transport): expose HTTP2 server keepalive interval and timeout (#486)
Adds two methods to `transport::server::Server` for setting HTTP2 server
keepalive interval and timeout as exposed by `hyper::server::Builder`.

Fixes #474
2021-01-05 13:35:45 -05:00
Jake GouldingandGitHub f58fcf31d1 Merge trailer and inital headers into status on err (#510)
The C++ gRPC server sometimes returns both headers and trailers. An
excerpt from Wireshark:

```
Stream: HEADERS, Stream ID: 1, Length 136, 200 OK
    Header: :status: 200 OK
    Header: x-middleware: expected value
    Header: content-type: application/grpc
    Header: grpc-accept-encoding: identity,deflate,gzip
    Header: accept-encoding: identity,gzip

Stream: HEADERS, Stream ID: 1, Length 92
    Header: grpc-status: 2
    Header: grpc-message: Unknown
    Header: x-arrow-status: 9
    Header: x-arrow-status-message-bin: VW5rbm93bg
```

Before this commit, only the metadata from the trailer would be
available, missing the `x-middleware` header:

```
MetadataMap {
    headers: {
        "x-arrow-status-message-bin": "VW5rbm93bg",
        "x-arrow-status": "9",
    },
}
```
2020-12-14 14:20:15 -05:00
Luca PalmieriandGitHub 2e964c78c6 feat(transport): Connect lazily in the load balanced channel (#493) 2020-11-18 14:26:49 -05:00
Juan AlvarezandGitHub f1275b611e chore: fix warnings in metadata module (#468) 2020-10-08 09:00:10 -05:00
Tyler HawkesandGitHub 1b03ece2a8 fix(build): Match namespace code with other generated packages (#472) 2020-10-07 11:30:22 -04:00
Juan AlvarezandGitHub 0c69c378fd chore: clippy lints (#467)
* chore: clippy lints
2020-09-29 14:38:49 -05:00
Lucio FrancoandGitHub 9ea4a64a6c examples: Add tower-client example (#466) 2020-09-29 11:16:07 -04:00
Juan AlvarezandGitHub d4899df832 feat(transport): add user-agent header to client requests. (#457)
* Add a default user-agent header to outgoing requests.
* The user agent can be configured through the `Channel` builder.

fixes #453
2020-09-23 18:58:03 -05:00
Juan AlvarezandGitHub e9910d10a7 fix(transport): reconnect lazy connections after first failure (#458)
* fix(transport): reconnect lazy connections after first failure

Channels created with lazy connections never try to reconnect if the
first connection attempt fails. This is because `Reconnect` returns
`Poll::Ready(Err)` on poll_ready and the service is considered dead.

This change passes a flag to Reconnect to signal if the connection
is intended to be lazy, in which case reconnect returns the error on
the next call.

fixes #452
2020-09-23 09:35:42 -05:00
Juan AlvarezandGitHub cea990b1ea run go client -> rust server interop tests (#446) 2020-09-22 16:24:26 -05:00
c7fd9d4586 chore(docs): Fix ClientTlsConfig::domain_name docs (#449)
Co-authored-by: Eric Lin <[email protected]>
2020-09-07 10:56:50 -05:00
Amanjeev SethiandGitHub 92a7cc86a6 tonic-build: (docs) adds NixOS related hints (#444) 2020-08-31 13:05:53 -04:00
Juan AlvarezandGitHub 48d5248925 chore: Update interop go binaries (#440) 2020-08-31 10:23:50 -05:00
Juan AlvarezandGitHub ca8e597e95 fix(interop) fix failing interop test with go client (#442)
* fix failing interop test

* do not run go client when --use_tls is set
2020-08-31 10:23:12 -05:00
Juan AlvarezandGitHub 26ce9d12bf fix(transport) Do not panic when building and Endpoint with an invali… (#438)
BREAKING CHANGE: `TryFrom` API has been changed.
2020-08-31 10:02:40 -04:00
Ximo GuanterandGitHub 62c1230117 fix(build): Add content-type for generated unimplemented service (#441) 2020-08-31 09:56:58 -04:00
Juan AlvarezandGitHub 40e64b53a7 chore: skip duplicate wasi crate from cargo deny check (#439) 2020-08-29 11:41:38 -05:00
594a542b8a fix(transport): Add content-type for Unimplemented (#434)
Co-authored-by: Lucio Franco <[email protected]>
2020-08-21 10:42:41 -04:00
bec4936daf doc(transport): improve connect_with_connector doc (#432)
Co-authored-by: Lucio Franco <[email protected]>
2020-08-20 16:14:35 -04:00
37f6733f85 feat(transport): Add Router::into_service (#419)
Co-authored-by: Danny Hua <[email protected]>
2020-08-20 15:11:31 -04:00
Lucio FrancoandGitHub 90858926b6 chore: Prepare 0.3.1 release (#436) 2020-08-20 10:49:12 -04:00
Lucio FrancoandGitHub 73938e1e0a chore: Fix typo in uds example (#417)
Closes #350
2020-07-27 15:38:47 -04:00
Lucio FrancoandGitHub 2ea17b2ecf fix(transport): Return connection error on Channel::connect (#413)
Before this fix, if the connect phase of the transport failed before
ever establishing a connection, we would never return the error until
the first call to send a request. This PR changes that behavior to only
forward the error to the call method if we have ever made a connection
before. If we have never established a connection before then
`Reconnect` will return an error on the call to `poll_ready`.

Fixes #403
2020-07-27 12:44:11 -04:00
Harry BarberandGitHub 5bd8a04baf Fix typo (#405) 2020-07-27 12:33:24 -04:00
Lucio FrancoandGitHub 8212afdf85 chore: Prepare tonic-health release 0.2.0 (#411) 2020-07-23 15:41:26 -04:00
Lucio FrancoandGitHub 2022fa9c53 chore: Ignore ansi_term in deny.toml (#406) 2020-07-20 16:58:28 -04:00
L1AN0andGitHub 96db606908 Fix typo in doc. (#398) 2020-07-14 16:41:39 -04:00
Lucio Franco ecb1920782 fix doc link 2020-07-13 13:02:44 -04:00
Lucio FrancoandGitHub 62b8ab0b51 chore: Prepare 0.3.0 release (#399)
* chore: Prepare 0.3.0 release

* update changelog

* fix builds

* Update breaking changes
2020-07-13 13:00:54 -04:00
Kaleb ElwertandGitHub 570c606397 chore: Upgrade base64 and tokio-rustls packages (#397) 2020-07-10 23:10:15 -05:00
Lucio FrancoandGitHub a567f17e52 chore: Prepare 0.2.2 release (#396) 2020-07-10 12:59:22 -04:00
Lucio FrancoandGitHub 2c4c544d90 fix: Status::details leaking base64 encoding (#395)
Fixes #379
2020-07-10 12:40:55 -04:00
Harry BarberandGitHub 2b997b0c5f feat(transport): Add optional service methods (#275) 2020-07-10 12:39:52 -04:00
034c850254 examples: update to tracing 0.1.16, use #[instrument] (#354)
* examples: update to `tracing` 0.1.14, use `#[instrument]`

Now that `tracing-attributes`'s `#[instrument]` macro plays nicely with
`async-trait`, we can update the tracing example to use `instrument`.
This lets us simplify the events emitted in the example.

Signed-off-by: Eliza Weisman <[email protected]>

* feat(transport): Dynamic load balancing (#341)

* Fix typo (#356)

Co-authored-by: Dawid Nowak <[email protected]>
Co-authored-by: Paulo Duarte <[email protected]>
2020-07-10 11:59:18 -04:00
Lucio FrancoandGitHub 98bcc339b1 Rename get_uri to uri (#393)
* Rename `get_uri` to `uri`

* Fix doc test
2020-07-10 11:45:33 -04:00