Skip to content

port timeout (and friends) to std::future#486

Merged
hawkw merged 7 commits intomaster-tokio-0.2from
eliza/0.2-timeout
Apr 23, 2020
Merged

port timeout (and friends) to std::future#486
hawkw merged 7 commits intomaster-tokio-0.2from
eliza/0.2-timeout

Conversation

@hawkw
Copy link
Contributor

@hawkw hawkw commented Apr 21, 2020

This branch ports the linkerd2-timeout crate and the
linkerd2-proxy-http crate's timeout module (which depends on it) to
use std::future and tokio 0.2's timers. I've also re-enabled the
push_* methods for timeout, probe_ready, fail_fast, and idle,
as well.

This change should be pretty straightforward to read, as it's fairly
mechanical in nature. I've basically just changed the code to account
for the new APIs, but the implementation should be quite similar.

@hawkw hawkw requested review from kleimkuhler and olix0r April 21, 2020 20:23
@hawkw hawkw self-assigned this Apr 21, 2020
@olix0r
Copy link
Member

olix0r commented Apr 21, 2020

To be clear... this depends on/follows #482? Should I review that one first?

@hawkw
Copy link
Contributor Author

hawkw commented Apr 21, 2020

@olix0r Yeah, that's correct. Sorry #482 is so huge, but it should unblock a lot of small, isolated PRs to update individual crates (like this one).

@hawkw hawkw force-pushed the eliza/0.2-timeout branch from 02b920b to 48a042a Compare April 22, 2020 17:58
@hawkw hawkw changed the base branch from eliza/0.2-serve to master-tokio-0.2 April 22, 2020 17:58
@hawkw
Copy link
Contributor Author

hawkw commented Apr 22, 2020

Rebased onto master-tokio-0.2

Copy link
Member

@olix0r olix0r left a comment

Choose a reason for hiding this comment

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

So happy to see the tokio::test cleanups!

@hawkw hawkw mentioned this pull request Apr 22, 2020
@hawkw
Copy link
Contributor Author

hawkw commented Apr 22, 2020

So happy to see the tokio::test cleanups!

The tokio-test crate also has a lot of really nice utilities for testing futures outside of an actual tokio runtime. I haven't used them here because I also needed timers to work (for obvious reasons), but the buffer PR shows them off rather nicely: https://github.com/linkerd/linkerd2-proxy/pull/488/files#diff-7f4858c542866bece52c0a8dfbca74adR44-R116

Copy link
Contributor

@kleimkuhler kleimkuhler left a comment

Choose a reason for hiding this comment

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

Looks good! +1 on the test cleanups!

@hawkw hawkw merged commit 2eb4c5a into master-tokio-0.2 Apr 23, 2020
hawkw added a commit that referenced this pull request Apr 24, 2020
This branch ports the `linkerd2-buffer` to use `std::future` and `tokio`
0.2. I've also re-enabled the `push_spawn_buffer` fns in `svc`.

Like #486 and #487, this change should be pretty straightforward to
read, as it's fairly mechanical in nature. I've basically just changed
the code to account for the new APIs. This one might be a _little_ more
interesting, since it shows off some of the API differences in
`tokio::sync` in 0.2 as well.

Signed-off-by: Eliza Weisman <[email protected]>
@olix0r olix0r deleted the eliza/0.2-timeout branch May 25, 2021 15:46
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