Conversation
a6f3a53 to
1816bf9
Compare
hawkw
left a comment
There was a problem hiding this comment.
I don't think most of the indirection in this PR is necessary. In general, we should only need to return Box<dyn Future> when we might conditionally return different concrete types that need to be erased by boxing. Otherwise, we should continue returning the same concrete types we did before.
58da728 to
a8a7d53
Compare
Signed-off-by: Zahari Dichev <[email protected]>
Signed-off-by: Zahari Dichev <[email protected]>
Signed-off-by: Zahari Dichev <[email protected]>
a8a7d53 to
6a0a622
Compare
Signed-off-by: Zahari Dichev <[email protected]>
olix0r
left a comment
There was a problem hiding this comment.
This is looking pretty close. I need to check it out and browse through it myself but I left some superficial comments (tioli)
Signed-off-by: Zahari Dichev <[email protected]>
hawkw
left a comment
There was a problem hiding this comment.
Overall, this change looks pretty good to me!
It would be good if there was an integration test asserting that a connection where no data is sent by the client times out at protocol detection correctly. I'm not sure how practical this is to test, but it would be nice to have.
In addition, I left some minor style comments. Hope they're helpful!
|
@hawkw I will add the test in a follow up PR if thats fine. At least it will be a good educational experience. |
linkerd/proxy/detect/src/lib.rs
Outdated
| target.take().expect("polled after complete"), | ||
| io.prefix().as_ref(), | ||
| ); | ||
| let inner_fut = accept.accept((target, BoxedIo::new(io))); |
There was a problem hiding this comment.
Just noting that there was a bug lurking in this change: we were no longer polling the accept to ready before dispatching. These changes were just superficial anyway, it seems, so I've backed this out to be as it was before.
This release includes a new protocol detection timeout, which prevents clients from consuming resources indefinitely when they do not send any data. Additionally: the proxy's admin endpoint now supports a `/live` endpoint for liveness checks, and a feature has been added to enrich tracing metadata from a file of label/values. --- * Add Labels from a path as oc-collector attributes (linkerd/linkerd2-proxy#463) * Add liveness endpoint to admin server (linkerd/linkerd2-proxy#470) * docker: Use buildkit for caching (linkerd/linkerd2-proxy#472) * Makefile: Use STRIP variable with strip as default (linkerd/linkerd2-proxy#475) * Add checksec to the release process (linkerd/linkerd2-proxy#476) * Time out protocol detect futures (linkerd/linkerd2-proxy#464) * Ensure that checksec is executable (linkerd/linkerd2-proxy#477) * Fix the checksec URL (linkerd/linkerd2-proxy#478) * Undo hardcoded release version (linkerd/linkerd2-proxy#479)
This release includes a new protocol detection timeout, which prevents clients from consuming resources indefinitely when they do not send any data. Additionally: the proxy's admin endpoint now supports a `/live` endpoint for liveness checks, and a feature has been added to enrich tracing metadata from a file of label/values. --- * Add Labels from a path as oc-collector attributes (linkerd/linkerd2-proxy#463) * Add liveness endpoint to admin server (linkerd/linkerd2-proxy#470) * docker: Use buildkit for caching (linkerd/linkerd2-proxy#472) * Makefile: Use STRIP variable with strip as default (linkerd/linkerd2-proxy#475) * Add checksec to the release process (linkerd/linkerd2-proxy#476) * Time out protocol detect futures (linkerd/linkerd2-proxy#464) * Ensure that checksec is executable (linkerd/linkerd2-proxy#477) * Fix the checksec URL (linkerd/linkerd2-proxy#478) * Undo hardcoded release version (linkerd/linkerd2-proxy#479)
This branch updates `master-tokio-0.2` from the latest `master`. A lot of this diff is totally unrelated and is largely ignoreable (e.g. changes to the docker build configuration, etc). However, there was also a decently large chunk of code that had changed in both `master-tokio-0.2` and on master. The majority of the merge conflicts were related to the changes to `Accept` in #464, because `Accept` had also been updated to use `std::future` on `master-tokio-0.2`. A review should probably focus on the `Accept` codepaths. Signed-off-by: Eliza Weisman <[email protected]>
This PR changes the Accept trait to return a Future<Item = Future<()>>. The inner future is the one driving the connection while the outer future represents work such as protocol detect. This allows us to time out the outer future independently of the inner one. Additionally a timeout has been introduced to guard against serve first connections that do not run on a standard for the protocol port hanging and causing memory issues.
Fixes linkerd/linkerd2#4069
Signed-off-by: Zahari Dichev [email protected]