Open olix0r opened 2 years ago
Some of the things that are definitely worth keeping an eye on:
The future of hyper
's use of the Service
trait: whether hyper
will use tower::Service
in 1.0 is currently up in the air. If tower-service
isn't 1.0 in time, it definitely won't. The question then becomes whether hyper
will provide its own Service
trait, or whether the interface will be changed significantly, potentially to one where user code calls into hyper
.
If hyper ends up moving away from tower-service
, there will definitely need to be some kind of glue layer (which could be a generic tower-hyper
crate or similar); the complexity of this adapter will depend on how different the interfaces end up being.
I/O traits: It's unclear whether hyper
1.0 is going to use Tokio's AsyncRead
/AsyncWrite
traits (as it does currently), or something else.
futures
, but not set in stone, especially if there's an eventual plan for AsyncRead
/AsyncWrite
in std
. tokio
and in futures-io
can ever efficiently support io_uring
-style async IO, where ownership of the buffer is transferred to the I/O resource (and then to the OS). This is a broader ecosystem-level question, but it's worth keeping an eye on.A bunch of stuff currently in hyper
will move to hyper-util
. This one is not a huge deal as that should generally be a pretty mechanical transformation.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
i've been driving this work forward recently, and was kindly pointed at this issue by @olix0r. i thought i'd lay down some thoughts on the work done thus far:
first, i drove a few small exploratory spikes into upgrading the proxy here, here, and here.
most of the friction related to this upgrade will be found in the linkerd-proxy-http
crate, which provides a number of core facilities wrapping hyper
's client and server interfaces used throughout the rest of the proxy.
i've landed a few preparatory changes, in linkerd/linkerd2-proxy#3379, linkerd/linkerd2-proxy#3380, and linkerd/linkerd2-proxy#3382. these pulled assorted standalone bits of http/hyper infrastructure that define http_body::Body
middleware out of the linkerd-proxy-http
library, and into their own distinct crates.
this will let us bump linkerd-http-classify
, linkerd-http-stream-timeouts
, linkerd-http-retain
, linkerd-http-override-authority
, [..] and other linkerd-http-*
crates up to hyper 1.0 in separate steps, which should both facilitate review and mitigate the risk of bugs slipping in while addressing the changes to the Body
trait in particular.
next, we can use the deprecated
and backports
feature flags provided in the 0.14
minor release to further prepare for the upgrade.
linkerd/linkerd2-proxy#3405 adds the deprecated
flag to the hyper dependencies in the cargo workspace, and #[allow(deprecated)]
attributes to code using deprecated hyper interfaces.
next, we'll address those deprecations, making use of the backports
feature. i've landed hyperium/hyper#3796 upstream to backport a 1.0 interface that we'll need before we can use the connection builder backported to 0.14.
Some of the things that are definitely worth keeping an eye on:
* **The future of `hyper`'s use of the `Service` trait**: [whether `hyper` will use `tower::Service` in 1.0](https://github.com/hyperium/hyper/blob/master/docs/ROADMAP.md#service) is currently up in the air. If `tower-service` isn't 1.0 in time, it definitely won't. The question then becomes whether `hyper` will provide its own `Service` trait, or whether the interface will be changed significantly, [potentially to one where user code calls into `hyper`](https://github.com/hyperium/hyper/blob/master/docs/ROADMAP.md#you-call-hyper-or-hyper-calls-you). If hyper ends up moving away from `tower-service`, there will definitely need to be some kind of glue layer (which could be a generic `tower-hyper` crate or similar); the complexity of this adapter will depend on how different the interfaces end up being. * **I/O traits**: It's unclear [whether `hyper` 1.0 is going to use Tokio's `AsyncRead`/`AsyncWrite` traits (as it does currently), or something else](https://github.com/hyperium/hyper/blob/master/docs/ROADMAP.md#runtime-woes). * It seems like the use of the Tokio traits is more likely than the version from `futures`, but not set in stone, especially if there's an eventual plan for `AsyncRead`/`AsyncWrite` in `std`. * There are also questions about whether the style of async I/O traits currently in `tokio` and in `futures-io` can ever efficiently support `io_uring`-style async IO, where ownership of the buffer is transferred to the I/O resource (and then to the OS). This is a broader ecosystem-level question, but it's worth keeping an eye on. * **A bunch of stuff currently in `hyper` will move to `hyper-util`.** This one is not a huge deal as that should _generally_ be a pretty mechanical transformation.
for the sake of closing the loop on the details above:
Service
trait: hyper
now provides its own Service
trait. glue connecting tower
to hyper
lives in the hyper-util
library: here.
I/O traits: hyper
provides its own Read
and Write
traits. glue connecting this to tokio
's traits lives in hyper-util::rt::tokio
.
hyper-util
motion: legacy client builder interfaces can be found in hyper_util::client::legacy
. see hyper-util::server
as well.
with linkerd/linkerd2-proxy#3405 landed, we're now in a good position to begin addressing particular deprecations in the hyper 0.14.31 interface to prepare the proxy for the hyper 1.0 upgrade.
linkerd/linkerd2-proxy#3411 is an example of one such change, handling calls to deprecated hyper::body
functions such as e.g. aggregate()
.
Hyper is planning a major 1.0 milestone that will impact many of their public APIs and, therefore, the proxy. We should get a better understanding of the planned changes so that we can begin to scope and plan the required proxy changes (and so that we can provide meaningful feedback before the APIs are finalized).