Commit Graph
386 Commits
Author SHA1 Message Date
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
Lucio FrancoandGitHub c9b3c7f11c Fix hyper_warp example warnings (#390) 2020-07-10 11:28:13 -04:00
Dan BurkertandGitHub ec9046dfc2 feat(transport): Add Endpoint::connect_lazy method (#392)
Fixes #167
2020-07-10 10:46:33 -04:00
Lucio FrancoandGitHub ea7fe66b14 feat(types): Add tonic-types crate (#391) 2020-07-08 18:01:16 -04:00
Mikail BagishovandGitHub ab1de44771 feat: Add Display implementation for Code (#386) 2020-07-06 14:07:08 -04:00
Sarfaraz NawazandGitHub d68dd36532 feat(codec): Improve compression flag log (#374) 2020-07-06 12:00:48 -04:00
Tunahan KarlıbaşandGitHub 9c954e0908 Make the cast in Bidirectional stream smaller (#387)
Since we already define the type we can just use it instead of writing it again
2020-07-06 11:58:07 -04:00
Lucio FrancoandGitHub 9c50d759de Fix deny warnings (#389) 2020-07-06 11:53:30 -04:00
Johan AnderssonandGitHub 3b9d6a6262 fix(transport): Propagate errors in tls_config instead of unwrap/panic (#385)
* Propagate errors in tls_config instead of unwrap

Ran into `tls_connector` failing and causing our app to panic and shutdown as it seems there wasn't any way to avoid panicking in `tls_config`.

So after talking to @LucioFranco briefly `tls_config` now returns a `Result` instead and propagates errors to the caller, where they can be handled.

* Fix compile warning when tls feature is disabled
2020-07-06 09:18:10 -04:00
Tyler HawkesandGitHub f085aba302 fix(build): Allow empty packages (#382)
Fixes #381
2020-06-29 11:24:47 -04:00
Kaleb ElwertandGitHub 327b4fffa3 feat: Add Status::to_http (#376) 2020-06-25 13:08:10 -04:00
Kaleb ElwertandGitHub 80e90e3b5d Add tower server example (#375)
Note that this also adds `impl From<Status> for http::Response<BoxBody>`
in order to make writing middleware which can return an error much
easier.
2020-06-22 12:04:02 -04:00
Sherlock HoloandGitHub 54d7a7af6b feat: add new method get_uri for Endpoint (#371) 2020-06-16 18:22:12 -04:00
CaioandGitHub 761029444f chore: Use new instead of with_rustls (#369) 2020-06-15 12:21:41 -04:00
Taiki EndoandGitHub 5bda615632 fix: Remove uses of pin_project::project attribute (#367)
pin-project will deprecate the project attribute due to some unfixable
limitations.

Refs: https://github.com/taiki-e/pin-project/issues/225
2020-06-09 13:09:35 -04:00