Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util: add a channel body #140

Merged
merged 4 commits into from
Jan 17, 2025
Merged

util: add a channel body #140

merged 4 commits into from
Jan 17, 2025

Conversation

cratelyn
Copy link
Contributor

@cratelyn cratelyn commented Jan 6, 2025

this branch represents a revival of #100, applying changes that were suggested in review. in particular, see 08aba95 and 4fed62f.

changes

use sync::oneshot for error channel

this commit refactors the channel-backed body in #100, changing the
mpsc::Receiver<E> used to transmit an error into a
oneshot::Receiver<E>.

this should improve memory usage, and make the channel a smaller
structure.

in order to achieve this, some minor adjustments are made:

  • use pin projection, projecting pinnedness to the oneshot receiver,
    polling it via core::future::Future::poll(..) to yield a body frame.

  • add Debug bounds were needed.

use &mut self method receivers

this commit refactors the channel-backed body in #100, changing the
signature of send_* methods on the sender to require a mutable
reference.

@cratelyn
Copy link
Contributor Author

cratelyn commented Jan 8, 2025

the msrv action failed here: https://github.com/hyperium/http-body/actions/runs/12635582609/job/35249835531

the relevant bit of our manifest getting in the way is the dep: prefix syntax, noted as being available only after rust 1.60. see the cargo book here: https://doc.rust-lang.org/cargo/reference/features.html#optional-dependencies

4a5b234 removes this syntax, to be backwards compatible with older rust versions.

@cratelyn
Copy link
Contributor Author

cratelyn commented Jan 8, 2025

ah, i just saw that #128 was merged yesterday. i've rebased on top of that, so we can use the dep: syntax in conditional dependencies. nice!

Copy link
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviving this! I'm excited to see it happen. One thought inline.

cratelyn added a commit to cratelyn/http-body that referenced this pull request Jan 10, 2025
see: hyperium#140 (comment)

this commit adds test coverage exposing the bug, and tightens the
pattern used to match frames yielded by the data channel.

now, when the channel is closed, a `None` will flow onwards and poll the
error channel. `None` will be returned when the error channel is closed,
which also indicates that the associated `Sender` has been dropped.
@cratelyn
Copy link
Contributor Author

cratelyn commented Jan 14, 2025

i see the MRSV listed in http-body-util's Cargo.toml as 1.61, here. #128 seems to imply that the MSRV is 1.61.

conversely, the logs in the failing action above mention using the 1.49 toolchain, here:

running `rustup toolchain add 1.49 --no-self-update`

my understanding is that this is because #128 did not update the rust-version field in the http-body crate. see:

rust-version = "1.49"

do you have a preference between: (a) respecting a 1.49 MSRV, restoring the changes in the commit mentioned above, or (b) updating the MSRV of http-body to match http-body-util, and keeping the dep: syntax?

@seanmonstar
Copy link
Member

Ah, interesting. I think that's happened is that cargo hack will check both MSRV versions set, but the error noticed here is because even though it's only compiling http-body, it has the to parse the whole workspace of Cargo.tomls, and it doesn't understand the one in http-body-util. Whereas the actual Rust code isn't compiled in that step, so it works when moving on to check the util crate.

I'm fine with making the http-body MSRV be whatever the minimum is needed to understad dep: syntax.

cratelyn added a commit to cratelyn/http-body that referenced this pull request Jan 15, 2025
this commit updates the MSRV of the `http-body` crate to 1.61.

this brings the `http-body` crate into step with the MSRV of the
`http-body-util` crate.

in hyperium#128, the MSRV of the `http-body-util` crate was update to 1.61.
however, compiling a crate in practice requires being able to parse all
of the package manifests in its workspace. this means that using more
recent features, like `dep:` syntax for optional dependencies included
via cargo features, will not work due to the older `1.49` toolchain
supported by `http-body`.

see the rust reference, here:
<https://doc.rust-lang.org/cargo/reference/features.html#optional-dependencies>

see hyperium#140, which depends on this commit.
cratelyn added a commit to cratelyn/http-body that referenced this pull request Jan 15, 2025
see: hyperium#140 (comment)

this commit adds test coverage exposing the bug, and tightens the
pattern used to match frames yielded by the data channel.

now, when the channel is closed, a `None` will flow onwards and poll the
error channel. `None` will be returned when the error channel is closed,
which also indicates that the associated `Sender` has been dropped.
@cratelyn
Copy link
Contributor Author

i've opened #141, which updates the MSRV, and rebased the commits in this PR to be based upon that change. i've also confirmed locally that cargo hack --rust-version --no-dev-deps check works as expected.

thanks for your help reviewing this, i am very excited to get this over the finish line. 🙂 🏁

seanmonstar pushed a commit that referenced this pull request Jan 15, 2025
this commit updates the MSRV of the `http-body` crate to 1.61.

this brings the `http-body` crate into step with the MSRV of the
`http-body-util` crate.

in #128, the MSRV of the `http-body-util` crate was update to 1.61.
however, compiling a crate in practice requires being able to parse all
of the package manifests in its workspace. this means that using more
recent features, like `dep:` syntax for optional dependencies included
via cargo features, will not work due to the older `1.49` toolchain
supported by `http-body`.

see the rust reference, here:
<https://doc.rust-lang.org/cargo/reference/features.html#optional-dependencies>

see #140, which depends on this commit.
davidpdrsn and others added 4 commits January 15, 2025 12:18
this applies a review suggestion here:
https://github.com/hyperium/http-body/pull/100/files#r1399781061

this commit refactors the channel-backed body in hyperium#100, changing the
`mpsc::Receiver<E>` used to transmit an error into a
`oneshot::Receiver<E>`.

this should improve memory usage, and make the channel a smaller
structure.

in order to achieve this, some minor adjustments are made:

* use pin projection, projecting pinnedness to the oneshot receiver,
  polling it via `core::future::Future::poll(..)` to yield a body frame.

* add `Debug` bounds were needed.

as an alternative, see tokio-rs/tokio#7059, which proposed a
`poll_recv(..)` inherent method for a oneshot channel receiver.
this applies a review suggestion here:
https://github.com/hyperium/http-body/pull/100/files#r1399780355

this commit refactors the channel-backed body in hyperium#100, changing the
signature of `send_*` methods on the sender to require a mutable
reference.
see: hyperium#140 (comment)

this commit adds test coverage exposing the bug, and tightens the
pattern used to match frames yielded by the data channel.

now, when the channel is closed, a `None` will flow onwards and poll the
error channel. `None` will be returned when the error channel is closed,
which also indicates that the associated `Sender` has been dropped.
@cratelyn
Copy link
Contributor Author

♻️ ...and now rebased on master now that #141 is merged!

Copy link
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@seanmonstar seanmonstar merged commit 86fdf00 into hyperium:master Jan 17, 2025
8 checks passed
@cratelyn cratelyn deleted the channel-2 branch February 2, 2025 01:48
cratelyn added a commit to cratelyn/http-body that referenced this pull request Feb 9, 2025
pr hyperium#140 introduced a new channel-backed body. this body provides a new
equivalent to the defunct `hyper::Body::channel()` interface that was
exposed in hyper 0.14, and removed in the 1.0 major release.

the previous `Sender` type also included a useful method,
`try_send_data()`, which allows a thread to _synchronously_ attempt to
send data _outside_ of an asynchronous context.

<https://docs.rs/hyper/0.14.31/hyper/body/struct.Sender.html#method.try_send_data>

this commit introduces a loosely equivalent `Sender::try_send()` method
to provide users of `http-body-util` with a means to send `Frame<T>`
values outside of an asynchronous context, without potentially
scheduling the caller to be woken later or yielding should the channel
be full.

this function accepts a `Frame<D>` rather than a chunk of data, to fit
in with the shift towards frame-oriented interfaces in `http-body` and
`http-body-util`.

Signed-off-by: katelyn martin <me+cratelyn@katelyn.world>
cratelyn added a commit to cratelyn/http-body that referenced this pull request Feb 9, 2025
this commit introduces two methods, allowing callers to inspect the
capacity, both available and maximum, of the channel-backed body.

this allows callers to observe when the channel is full.

Signed-off-by: katelyn martin <me+cratelyn@katelyn.world>
X-Ref: hyperium#140
seanmonstar pushed a commit that referenced this pull request Feb 18, 2025
pr #140 introduced a new channel-backed body. this body provides a new
equivalent to the defunct `hyper::Body::channel()` interface that was
exposed in hyper 0.14, and removed in the 1.0 major release.

the previous `Sender` type also included a useful method,
`try_send_data()`, which allows a thread to _synchronously_ attempt to
send data _outside_ of an asynchronous context.

<https://docs.rs/hyper/0.14.31/hyper/body/struct.Sender.html#method.try_send_data>

this commit introduces a loosely equivalent `Sender::try_send()` method
to provide users of `http-body-util` with a means to send `Frame<T>`
values outside of an asynchronous context, without potentially
scheduling the caller to be woken later or yielding should the channel
be full.

this function accepts a `Frame<D>` rather than a chunk of data, to fit
in with the shift towards frame-oriented interfaces in `http-body` and
`http-body-util`.

Signed-off-by: katelyn martin <me+cratelyn@katelyn.world>
cratelyn added a commit to cratelyn/http-body that referenced this pull request Mar 1, 2025
this commit introduces two methods, allowing callers to inspect the
capacity, both available and maximum, of the channel-backed body.

this allows callers to observe when the channel is full.

Signed-off-by: katelyn martin <me+cratelyn@katelyn.world>
X-Ref: hyperium#140
seanmonstar pushed a commit that referenced this pull request Mar 1, 2025
this commit introduces two methods, allowing callers to inspect the
capacity, both available and maximum, of the channel-backed body.

this allows callers to observe when the channel is full.


X-Ref: #140

Signed-off-by: katelyn martin <me+cratelyn@katelyn.world>
cratelyn added a commit to linkerd/linkerd2-proxy that referenced this pull request Mar 10, 2025
note: this commit will not compile, code changes are intentionally
elided from this commit.

this commit upgrades hyper, http, tonic, prost, related dependencies,
and their assorted cargo features.

see <linkerd/linkerd2#8733>.

see also:

* #3379
* #3380
* #3382
* #3405
* hyperium/hyper#3796
* #3411
* #3421
* #3427
* #3428
* #3432
* #3433
* #3444
* #3445
* #3454
* #3455
* #3456
* #3457
* #3461
* #3459
* #3465
* #3466
* #3467
* #3468
* linkerd/linkerd2-proxy-api#421
* linkerd/linkerd2#13492
* linkerd/linkerd2#13493
* hyperium/hyper#3816
* #3472
* #3473
* #3479
* tokio-rs/tokio#7059
* #3509
* hyperium/http-body#140
* #3515
* hyperium/http-body#141
* #3530
* #3531
* #3540
* #3556
* #3558
* #3559
* #3564
* #3567
* #3573
* #3583
* hyperium/http-body#144
* #3585
* #3586
* #3597
* #3598
* #3611
* #3614
* #3615
* #3616
* #3647
* #3651
* #3653
* #3654
* #3655
* #3656
* #3657
* #3660
* #3671
* #3672
* #3673
* #3676
* hyperium/http-body#147
* #3692
* #3699
* #3700
* #3701
* #3708
* linkerd/drain-rs#36
* #3715
* #3717
* eminence/procfs#340

---

squash:

chore(deps): add hyper-util workspace dependency

chore(deps): add http-body-util workspace dependency

chore(deps): upgrade linkerd2-proxy-api

this commit represents main as of linkerd/linkerd2-proxy-api#421.

Signed-off-by: katelyn martin <kate@buoyant.io>
cratelyn added a commit to linkerd/linkerd2-proxy that referenced this pull request Mar 11, 2025
note: this commit will not compile, code changes are intentionally
elided from this commit.

this commit upgrades hyper, http, tonic, prost, related dependencies,
and their assorted cargo features.

see <linkerd/linkerd2#8733>.

see also:

* #3379
* #3380
* #3382
* #3405
* hyperium/hyper#3796
* #3411
* #3421
* #3427
* #3428
* #3432
* #3433
* #3444
* #3445
* #3454
* #3455
* #3456
* #3457
* #3461
* #3459
* #3465
* #3466
* #3467
* #3468
* linkerd/linkerd2-proxy-api#421
* linkerd/linkerd2#13492
* linkerd/linkerd2#13493
* hyperium/hyper#3816
* #3472
* #3473
* #3479
* tokio-rs/tokio#7059
* #3509
* hyperium/http-body#140
* #3515
* hyperium/http-body#141
* #3530
* #3531
* #3540
* #3556
* #3558
* #3559
* #3564
* #3567
* #3573
* #3583
* hyperium/http-body#144
* #3585
* #3586
* #3597
* #3598
* #3611
* #3614
* #3615
* #3616
* #3647
* #3651
* #3653
* #3654
* #3655
* #3656
* #3657
* #3660
* #3671
* #3672
* #3673
* #3676
* hyperium/http-body#147
* #3692
* #3699
* #3700
* #3701
* #3708
* linkerd/drain-rs#36
* #3715
* #3717
* eminence/procfs#340

---

squash:

chore(deps): add hyper-util workspace dependency

chore(deps): add http-body-util workspace dependency

chore(deps): upgrade linkerd2-proxy-api

this commit represents main as of linkerd/linkerd2-proxy-api#421.

Signed-off-by: katelyn martin <kate@buoyant.io>
cratelyn added a commit to linkerd/linkerd2-proxy that referenced this pull request Mar 12, 2025
note: this commit will not compile, code changes are intentionally
elided from this commit.

this commit upgrades hyper, http, tonic, prost, related dependencies,
and their assorted cargo features.

see <linkerd/linkerd2#8733>.

see also:

* #3379
* #3380
* #3382
* #3405
* hyperium/hyper#3796
* #3411
* #3421
* #3427
* #3428
* #3432
* #3433
* #3444
* #3445
* #3454
* #3455
* #3456
* #3457
* #3461
* #3459
* #3465
* #3466
* #3467
* #3468
* linkerd/linkerd2-proxy-api#421
* linkerd/linkerd2#13492
* linkerd/linkerd2#13493
* hyperium/hyper#3816
* #3472
* #3473
* #3479
* tokio-rs/tokio#7059
* #3509
* hyperium/http-body#140
* #3515
* hyperium/http-body#141
* #3530
* #3531
* #3540
* #3556
* #3558
* #3559
* #3564
* #3567
* #3573
* #3583
* hyperium/http-body#144
* #3585
* #3586
* #3597
* #3598
* #3611
* #3614
* #3615
* #3616
* #3647
* #3651
* #3653
* #3654
* #3655
* #3656
* #3657
* #3660
* #3671
* #3672
* #3673
* #3676
* hyperium/http-body#147
* #3692
* #3699
* #3700
* #3701
* #3708
* linkerd/drain-rs#36
* #3715
* #3717
* eminence/procfs#340

---

squash:

chore(deps): add hyper-util workspace dependency

chore(deps): add http-body-util workspace dependency

chore(deps): upgrade linkerd2-proxy-api

this commit represents main as of linkerd/linkerd2-proxy-api#421.

Signed-off-by: katelyn martin <kate@buoyant.io>
cratelyn added a commit to linkerd/linkerd2-proxy that referenced this pull request Mar 12, 2025
note: this commit will not compile, code changes are intentionally
elided from this commit.

this commit upgrades hyper, http, tonic, prost, related dependencies,
and their assorted cargo features.

see <linkerd/linkerd2#8733>.

see also:

* #3379
* #3380
* #3382
* #3405
* hyperium/hyper#3796
* #3411
* #3421
* #3427
* #3428
* #3432
* #3433
* #3444
* #3445
* #3454
* #3455
* #3456
* #3457
* #3461
* #3459
* #3465
* #3466
* #3467
* #3468
* linkerd/linkerd2-proxy-api#421
* linkerd/linkerd2#13492
* linkerd/linkerd2#13493
* hyperium/hyper#3816
* #3472
* #3473
* #3479
* tokio-rs/tokio#7059
* #3509
* hyperium/http-body#140
* #3515
* hyperium/http-body#141
* #3530
* #3531
* #3540
* #3556
* #3558
* #3559
* #3564
* #3567
* #3573
* #3583
* hyperium/http-body#144
* #3585
* #3586
* #3597
* #3598
* #3611
* #3614
* #3615
* #3616
* #3647
* #3651
* #3653
* #3654
* #3655
* #3656
* #3657
* #3660
* #3671
* #3672
* #3673
* #3676
* hyperium/http-body#147
* #3692
* #3699
* #3700
* #3701
* #3708
* linkerd/drain-rs#36
* #3715
* #3717
* eminence/procfs#340

---

squash:

chore(deps): add hyper-util workspace dependency

chore(deps): add http-body-util workspace dependency

chore(deps): upgrade linkerd2-proxy-api

this commit represents main as of linkerd/linkerd2-proxy-api#421.

Signed-off-by: katelyn martin <kate@buoyant.io>
cratelyn added a commit to linkerd/linkerd2-proxy that referenced this pull request Mar 14, 2025
note: this commit will not compile, code changes are intentionally
elided from this commit.

this commit upgrades hyper, http, tonic, prost, related dependencies,
and their assorted cargo features.

see <linkerd/linkerd2#8733>.

see also:

* #3379
* #3380
* #3382
* #3405
* hyperium/hyper#3796
* #3411
* #3421
* #3427
* #3428
* #3432
* #3433
* #3444
* #3445
* #3454
* #3455
* #3456
* #3457
* #3461
* #3459
* #3465
* #3466
* #3467
* #3468
* linkerd/linkerd2-proxy-api#421
* linkerd/linkerd2#13492
* linkerd/linkerd2#13493
* hyperium/hyper#3816
* #3472
* #3473
* #3479
* tokio-rs/tokio#7059
* #3509
* hyperium/http-body#140
* #3515
* hyperium/http-body#141
* #3530
* #3531
* #3540
* #3556
* #3558
* #3559
* #3564
* #3567
* #3573
* #3583
* hyperium/http-body#144
* #3585
* #3586
* #3597
* #3598
* #3611
* #3614
* #3615
* #3616
* #3647
* #3651
* #3653
* #3654
* #3655
* #3656
* #3657
* #3660
* #3671
* #3672
* #3673
* #3676
* hyperium/http-body#147
* #3692
* #3699
* #3700
* #3701
* #3708
* linkerd/drain-rs#36
* #3715
* #3717
* eminence/procfs#340

---

squash:

chore(deps): add hyper-util workspace dependency

chore(deps): add http-body-util workspace dependency

chore(deps): upgrade linkerd2-proxy-api

this commit represents main as of linkerd/linkerd2-proxy-api#421.

Signed-off-by: katelyn martin <kate@buoyant.io>
cratelyn added a commit to linkerd/linkerd2-proxy that referenced this pull request Mar 18, 2025
note: this commit will not compile, code changes are intentionally
elided from this commit.

this commit upgrades hyper, http, tonic, prost, related dependencies,
and their assorted cargo features.

see <linkerd/linkerd2#8733>.

see also:

* #3379
* #3380
* #3382
* #3405
* hyperium/hyper#3796
* #3411
* #3421
* #3427
* #3428
* #3432
* #3433
* #3444
* #3445
* #3454
* #3455
* #3456
* #3457
* #3461
* #3459
* #3465
* #3466
* #3467
* #3468
* linkerd/linkerd2-proxy-api#421
* linkerd/linkerd2#13492
* linkerd/linkerd2#13493
* hyperium/hyper#3816
* #3472
* #3473
* #3479
* tokio-rs/tokio#7059
* #3509
* hyperium/http-body#140
* #3515
* hyperium/http-body#141
* #3530
* #3531
* #3540
* #3556
* #3558
* #3559
* #3564
* #3567
* #3573
* #3583
* hyperium/http-body#144
* #3585
* #3586
* #3597
* #3598
* #3611
* #3614
* #3615
* #3616
* #3647
* #3651
* #3653
* #3654
* #3655
* #3656
* #3657
* #3660
* #3671
* #3672
* #3673
* #3676
* hyperium/http-body#147
* #3692
* #3699
* #3700
* #3701
* #3708
* linkerd/drain-rs#36
* #3715
* #3717
* eminence/procfs#340

---

squash:

chore(deps): add hyper-util workspace dependency

chore(deps): add http-body-util workspace dependency

chore(deps): upgrade linkerd2-proxy-api

this commit represents main as of linkerd/linkerd2-proxy-api#421.

Signed-off-by: katelyn martin <kate@buoyant.io>
cratelyn added a commit to linkerd/linkerd2-proxy that referenced this pull request Mar 18, 2025
note: this commit will not compile, code changes are intentionally
elided from this commit.

this commit upgrades hyper, http, tonic, prost, related dependencies,
and their assorted cargo features.

see <linkerd/linkerd2#8733>.

see also:

* #3379
* #3380
* #3382
* #3405
* hyperium/hyper#3796
* #3411
* #3421
* #3427
* #3428
* #3432
* #3433
* #3444
* #3445
* #3454
* #3455
* #3456
* #3457
* #3461
* #3459
* #3465
* #3466
* #3467
* #3468
* linkerd/linkerd2-proxy-api#421
* linkerd/linkerd2#13492
* linkerd/linkerd2#13493
* hyperium/hyper#3816
* #3472
* #3473
* #3479
* tokio-rs/tokio#7059
* #3509
* hyperium/http-body#140
* #3515
* hyperium/http-body#141
* #3530
* #3531
* #3540
* #3556
* #3558
* #3559
* #3564
* #3567
* #3573
* #3583
* hyperium/http-body#144
* #3585
* #3586
* #3597
* #3598
* #3611
* #3614
* #3615
* #3616
* #3647
* #3651
* #3653
* #3654
* #3655
* #3656
* #3657
* #3660
* #3671
* #3672
* #3673
* #3676
* hyperium/http-body#147
* #3692
* #3699
* #3700
* #3701
* #3708
* linkerd/drain-rs#36
* #3715
* #3717
* eminence/procfs#340

---

squash:

chore(deps): add hyper-util workspace dependency

chore(deps): add http-body-util workspace dependency

chore(deps): upgrade linkerd2-proxy-api

this commit represents main as of linkerd/linkerd2-proxy-api#421.

Signed-off-by: katelyn martin <kate@buoyant.io>
cratelyn added a commit to linkerd/linkerd2-proxy that referenced this pull request Mar 21, 2025
## ✨ chore(deps): upgrade to hyperium 1.x crates

this branch performs an exciting upgrade for our proxy.

this branch upgrades a number of our dependencies so that we use the 1.0
release family of the `hyper` http framework, and its ecosystem. see the
[v1.0 announcement][hyper-v1] for more information.

this branch upgrades the following dependencies:

* `h2`: 0.3 -> 0.4
* `http`: 0.2 -> 1
* `http-body`: 0.4 -> 1
* `hyper`: 0.14.32 -> 1
* `prost`: 0.12 -> 0.13
* `prost-build`: 0.12 -> 0.13
* `prost-types`: 0.12 -> 0.13
* `tonic`: 0.10 -> 0.12
* `tonic-build`: 0.10 -> 0.12

a `hyper-util` dependency is added, which provides among other things,
legacy-compatible interfaces such as `hyper_util::client::legacy::Client`, or
glue to use `hyper` with the tokio runtime.

see <https://docs.rs/hyper-util/latest/hyper_util/> for more information.

a `http-body-util` dependency is added, which provides a `BodyExt` trait and a
channel-backed body for use in unit tests. the `deprecated` feature flag that
was active on our `0.14` hyper dependency has been removed, along with the
`stream` and `runtime` feature flags.

the `linkerd2-proxy-api` dependency is updated. see:
<linkerd/linkerd2-proxy-api#421>

### 📝 notes for review

bear particular attention to changes involving `http_body::Body` middleware.

the change from two separate `poll_data()` and `poll_trailers()` functions,
to a single `poll_frame()` method, induces some subtle changes to various
pieces of middleware.

also bear in mind that failing to set a timer, in our case
`hyper_util::rt::TokioTimer`, can cause http/2 clients, or http/1 and http/2
servers, to panic. make sure that any uses of
`hyper::server::conn::http1::Builder`, `hyper::client::conn::http1::Builder`,
or `hyper::client::conn::http2::Builder` install a timer.

### ❗ breaking change: `l5d-proxy-error` values

the `l5d-proxy-error` header can be examined to observe the cause of proxy
errors encountered when sending meshed traffic. by virtue of this using a newer
`hyper` client in the proxy, some error messages may in turn look different.
for example, an error like `"connect timed out after 1s"` may now appear as
`"client error (Connect)"`.

### 📚 other notes

this work, by virtue of touching so many parts of the system, is carried out
in distinct commits. an initial commit upgrades the dependencies at th
workspace level. subsequent commits will not compile if the `--workspace` flag
is provided, but the intent of this branch is to update each crate
individually.

use commands like, e.g. `cargo check --tests -p linkerd-proxy-http` to build
particular crates at intermediate commits within this branch.

this commit is also only the final leaf in an _extended_ line of work. this
has been done to mitigate the effort of reviewing this change, and the risk of
churn in the event of any unanticipated errors. see the top-level comment in
linkerd/linkerd2#8733 for an overview of all of the
work that brought us to this juncture.

[hyper-v1]: https://seanmonstar.com/blog/hyper-v1/

---

* chore(deps): upgrade to hyper 1.x

note: this commit will not compile, code changes are intentionally
elided from this commit.

this commit upgrades hyper, http, tonic, prost, related dependencies,
and their assorted cargo features.

see <linkerd/linkerd2#8733>.

see also:

* #3379
* #3380
* #3382
* #3405
* hyperium/hyper#3796
* #3411
* #3421
* #3427
* #3428
* #3432
* #3433
* #3444
* #3445
* #3454
* #3455
* #3456
* #3457
* #3461
* #3459
* #3465
* #3466
* #3467
* #3468
* linkerd/linkerd2-proxy-api#421
* linkerd/linkerd2#13492
* linkerd/linkerd2#13493
* hyperium/hyper#3816
* #3472
* #3473
* #3479
* tokio-rs/tokio#7059
* #3509
* hyperium/http-body#140
* #3515
* hyperium/http-body#141
* #3530
* #3531
* #3540
* #3556
* #3558
* #3559
* #3564
* #3567
* #3573
* #3583
* hyperium/http-body#144
* #3585
* #3586
* #3597
* #3598
* #3611
* #3614
* #3615
* #3616
* #3647
* #3651
* #3653
* #3654
* #3655
* #3656
* #3657
* #3660
* #3671
* #3672
* #3673
* #3676
* hyperium/http-body#147
* #3692
* #3699
* #3700
* #3701
* #3708
* linkerd/drain-rs#36
* #3715
* #3717
* eminence/procfs#340

---

squash:

chore(deps): add hyper-util workspace dependency

chore(deps): add http-body-util workspace dependency

chore(deps): upgrade linkerd2-proxy-api

this commit represents main as of linkerd/linkerd2-proxy-api#421.

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(http/box): upgrade to hyper 1.x

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(hyper-balance): upgrade to hyper 1.x

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(http/retain): ugrade to hyper 1.x

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(http/stream-timeouts): upgrade to hyper 1.x

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(http/classify): upgrade to hyper 1.x

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(http/upgrade): upgrade to hyper 1.x

NOTE: there is a comment noting that the upgrade middleware does not
expect to be cloneable. it is unfortunately, however, at odds with the
new bounds expected of extensions.

so, `Http11Upgrade` is now Clone'able, but a comment is left in place
noting this weakened invariant.

it's worth investigating how upgrades have changed since, in more
detail, but for the current moment we are interested in being
especially conservative about changing behavior, and focusing on api
changes like `Body::poll_frame(..)`.

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(metrics): upgrade to hyper 1.x

a brief note; this commit happened to tickle an unfortunate sharp edge
in `BoxBody` and `Full`'s respective constructors. type inference could
not figure out how to construct the body, so we refrain from boxing the
response body now.

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(http/metrics): upgrade to hyper 1.x

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(http/prom): upgrade to hyper 1.x

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(http/insert): upgrade to hyper 1.x

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(http/retry): deprecate linkerd-http-body-compat

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(mock/http-body): upgrade to hyper 1.x

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(http/retry): upgrade to hyper 1.x

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(proxy/tap): upgrade to hyper 1.x

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(proxy/http): update to hyper 1.x

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(app/core): upgrade to hyper 1.x

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(app/test): upgrade to hyper 1.x

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(app/admin): upgrade to hyper 1.x

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(app/outbound): upgrade to hyper 1.x

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(app/inbound): upgrade to hyper 1.x

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(app/integration): upgrade to hyper 1.x

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(app): upgrade to hyper 1.x

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(transport-header): update generated code

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(spiffe-proto): update generated code

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(opencensus-proto): update generated code

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(opentelemetry-proto): update generated code

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(deny.toml): update cargo-deny directives

this commit updates the contents of `deny.toml`.

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore: `compile` has been renamed to `compile_protos`

this addresses deprecation warnings, updating calls to a function that
has since been renamed.

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(deps): remove `linkerd-http-body-compat` dependencies

this commit removes this crate, which we added to future proof code for
this upgrade, from its dependents.

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(http/body-compat): remove `linkerd-http-body-compat` crate

Signed-off-by: katelyn martin <kate@buoyant.io>

* chore(deps): update to drain 0.2.1

see linkerd/drain-rs#41.

Signed-off-by: katelyn martin <kate@buoyant.io>

---------

Signed-off-by: katelyn martin <kate@buoyant.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants