-
Notifications
You must be signed in to change notification settings - Fork 271
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(app/inbound): address server::conn::Http
deprecations
#3432
Conversation
this was not being flagged as an unused variable, due to the `#[instrument]` attribute. (😉 _it's used as a field in the generated span!_) `connect_timeout(..)` doesn't use its parameter. to address some deprecations, and avoid the need for polymorphism / refactoring related to http/1 and http/2 connections being represented as distinct types in the hyper 1.0 api, we remove it. Signed-off-by: katelyn martin <[email protected]>
this addresses hyper 1.0 deprecations in the server side of the inbound proxy's http unit test suite logic. see <linkerd/linkerd2#8733> for more information. the client end of this change ends up being slightly involved, due to changes that will need to be made in `linkerd_app_test::http_util`. accordingly, those deprecations will be addressed in a subsequent commit. Signed-off-by: katelyn martin <[email protected]>
#[allow(deprecated)] // linkerd/linkerd2#8733 | ||
fn connect_timeout( | ||
http: hyper::server::conn::Http, | ||
) -> Box<dyn FnMut(Remote<ServerAddr>) -> ConnectFuture + Send> { | ||
fn connect_timeout() -> Box<dyn FnMut(Remote<ServerAddr>) -> ConnectFuture + Send> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like #3421, this is another exercise in dodging deprecation work by... removing things! 🙂
http: hyper::server::conn::Http, | ||
server: hyper::server::conn::http1::Builder, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this...
http: hyper::server::conn::Http, | ||
server: hyper::server::conn::http2::Builder<TracingExecutor>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...and this, are the other core of this branch. we can tweak these types, without having to do any additional refactoring.
i'm punting the client end of this change into a separate branch, as mentioned in the description, because we currently share common helper functions for the http/1 and http/2 clients.
auto-merge enabled! 🤖 |
this commit changes the `connect_and_accept(..)` helper function used in the proxy's unit tests, altering its logic such that it now runs background tasks inside of a `JoinSet`. then, subsequent commits hoist code out of `run_proxy()` and `connect_client()`, and consolidate our `async move {}` blocks. this both simplifies the control flow of this test infrastructure, but also addresses some more hyper deprecations. for more information about our progressing upgrade to hyper 1.0, see linkerd/linkerd2#8733. NB: this branch is based upon #3432. --- * refactor(app/inbound): remove unused `Http` parameter this was not being flagged as an unused variable, due to the `#[instrument]` attribute. (😉 _it's used as a field in the generated span!_) `connect_timeout(..)` doesn't use its parameter. to address some deprecations, and avoid the need for polymorphism / refactoring related to http/1 and http/2 connections being represented as distinct types in the hyper 1.0 api, we remove it. Signed-off-by: katelyn martin <[email protected]> * chore(app/inbound): address `server::conn::Http` deprecations this addresses hyper 1.0 deprecations in the server side of the inbound proxy's http unit test suite logic. see <linkerd/linkerd2#8733> for more information. the client end of this change ends up being slightly involved, due to changes that will need to be made in `linkerd_app_test::http_util`. accordingly, those deprecations will be addressed in a subsequent commit. Signed-off-by: katelyn martin <[email protected]> * refactor(app/test): reorder and document test helpers this moves the public `connect_client(..)` function up to the top of the group of functions, and adds a documentation comment explaining its purpose. a todo comment is left noting that this can be refactored to use tokio's new `JoinSet` type. Signed-off-by: katelyn martin <[email protected]> * refactor(app/test): briefly defer `spawn()`ing tasks this is a small tweak, defering the call to `tokio::spawn(..)` to make using `JoinSet` easier. Signed-off-by: katelyn martin <[email protected]> * refactor(app/test): use `JoinSet` for background tasks this commit changes the `connect_and_accept(..)` helper function used in the proxy's unit tests, altering its logic such that it now runs background tasks inside of a `JoinSet`. Signed-off-by: katelyn martin <[email protected]> * refactor(app/test): tweak proxy process this commit makes two minor changes to the `run_proxy()` helper function: * remove a frivolous `.map(|_| ())` on a result that already had a tuple `Ok` type. * use `ServiceExt::oneshot` for brevity. this should have no effect on the tests, we're just golfing things down a bit. Signed-off-by: katelyn martin <[email protected]> * refactor(app/test): hoist `instrument(..)` calls Signed-off-by: katelyn martin <[email protected]> * refactor(app/test): remove `run_proxy(..)` we've nudged this along well enough that this function can now reasonably be removed. Signed-off-by: katelyn martin <[email protected]> * refactor(app/test): remove `connect_client(..)` and once more, we remove a helper function that isn't doing quite so much work, and whose signature contains deprecated hyper 1.0 types. Signed-off-by: katelyn martin <[email protected]> * refactor(app/test): consolidate anonymous futures we create `async move {}` blocks in multiple places, without any clear benefit. this commit consolidates them into one place: when we spawn a task onto the `JoinSet`. Signed-off-by: katelyn martin <[email protected]> --------- Signed-off-by: katelyn martin <[email protected]>
this addresses hyper 1.0 deprecations in the server side of the inbound
proxy's http unit test suite logic.
see linkerd/linkerd2#8733 for more
information.
the client end of this change ends up being slightly involved, due to
changes that will need to be made in
linkerd_app_test::http_util
.accordingly, those deprecations will be addressed in a subsequent
commit.