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

chore(deps): address hyper deprecations in policy controller #13493

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cratelyn
Copy link
Contributor

@cratelyn cratelyn commented Dec 18, 2024

NB: this branch is based upon #13492. see #8733 for more information about migrating to hyper 1.0.

this enables the backports and deprecated feature flags in the hyper dependencies in this project, and addresses warnings. see https://hyper.rs/guides/1/upgrading/ for more information about these feature flags.

largely, the control plane is unaffected by this upgrade, besides the following changes:

  • one usage of a deprecated hyper::body::aggregate function is updated.

  • a hyper::rt::Executor<E> implementation, which spawns tasks onto the tokio runtime, is provided. once we upgrade to hyper 1.0, we can replace this with the executor provided in hyper-util.

  • the hyper::service::Service<hyper::Request<tonic::body::BoxBody>> implementation for GrpcHttp now boxes its returned future, on account of SendRequest returning an anonymous impl Future<Output = ...>.

  • the policy-test additionally depends on the runtime feature of hyper. this is an artifact of an internal config structure shared by the legacy connection builder and the backported connection builder containing two keep-alive fields that were feature gated prior to 1.0.

this contains some small patches that we're interested in, before we
address deprecations and upgrade to hyper 1.0.

see #8733 for more information.

Signed-off-by: katelyn martin <[email protected]>
@cratelyn cratelyn force-pushed the kate/hyper-1.x-upgrade branch from f68339e to f6468a9 Compare December 18, 2024 02:27
NB: this branch is based upon #13492. see #8733 for more information
about migrating to hyper 1.0.

this enables the `backports` and `deprecated` feature flags in the hyper
dependencies in this project, and addresses warnings. see
<https://hyper.rs/guides/1/upgrading/> for more information about these
feature flags.

largely, the control plane is unaffected by this upgrade, besides the
following changes:

* one usage of a deprecated `hyper::body::aggregate` function is
  updated.

* a `hyper::rt::Executor<E>` implementation, which spawns tasks onto the
  tokio runtime, is provided. once we upgrade to hyper 1.0, we can
  replace this with the executor provided in
  [`hyper-util`](https://docs.rs/hyper-util/latest/hyper_util/rt/tokio/struct.TokioExecutor.html#impl-Executor%3CFut%3E-for-TokioExecutor).

* the `hyper::service::Service<hyper::Request<tonic::body::BoxBody>>`
  implementation for `GrpcHttp` now boxes its returned future, on
  account of `SendRequest` returning an anonymous
  `impl Future<Output = ...>`.

* the `policy-test` additionally depends on the `runtime` feature of
  hyper. this is an artifact of an internal config structure shared by
  the legacy connection builder and the backported connection builder
  containing two keep-alive fields that were feature gated prior to 1.0.

Signed-off-by: katelyn martin <[email protected]>
@cratelyn cratelyn force-pushed the kate/hyper-1.x-upgrade branch from f6468a9 to 36c17fb Compare December 18, 2024 02:33
@cratelyn cratelyn changed the title chore(deps): address hyper deprecations in policy controllers chore(deps): address hyper deprecations in policy controller Dec 18, 2024
@cratelyn
Copy link
Contributor Author

there's some feature flags to fight before i open this up for review. 🎏

@cratelyn
Copy link
Contributor Author

ci was failing for this reason:

error: could not compile `hyper` (lib) due to 2 previous errors
Error: build failed
Error: error[E0609]: no field `keep_alive_interval` on type `h2::server::Config`
   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-0.14.32/src/server/conn/http2.rs:199:25
    |
199 |         self.h2_builder.keep_alive_interval = interval.into();
    |                         ^^^^^^^^^^^^^^^^^^^ unknown field
    |
    = note: available fields are: `adaptive_window`, `initial_conn_window_size`, `initial_stream_window_size`, `max_frame_size`, `enable_connect_protocol` ... and 5 others


error: Recipe `_rs-check-dir` failed on line 102 with exit code 1
error: Recipe `rs-check-dirs` failed with exit code 1
Error: error[E0609]: no field `keep_alive_timeout` on type `h2::server::Config`
   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-0.14.32/src/server/conn/http2.rs:213:25
    |
213 |         self.h2_builder.keep_alive_timeout = timeout;
    |                         ^^^^^^^^^^^^^^^^^^ unknown field
    |
    = note: available fields are: `adaptive_window`, `initial_conn_window_size`, `initial_stream_window_size`, `max_frame_size`, `enable_connect_protocol` ... and 5 others


Error: Process completed with exit code 1.

i've landed hyperium/hyper#3816 upstream to conditionally compile these interfaces in the backported http/2 server connection builder.

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.

1 participant