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

app: Move retry types into the app-outbound crate #1378

Merged
merged 1 commit into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,6 @@ dependencies = [
"linkerd-exp-backoff",
"linkerd-http-classify",
"linkerd-http-metrics",
"linkerd-http-retry",
"linkerd-identity",
"linkerd-io",
"linkerd-meshtls",
Expand All @@ -856,7 +855,6 @@ dependencies = [
"linkerd-proxy-tcp",
"linkerd-proxy-transport",
"linkerd-reconnect",
"linkerd-retry",
"linkerd-service-profiles",
"linkerd-stack",
"linkerd-stack-metrics",
Expand Down Expand Up @@ -966,11 +964,13 @@ dependencies = [
"hyper",
"linkerd-app-core",
"linkerd-app-test",
"linkerd-http-classify",
"linkerd-http-retry",
"linkerd-identity",
"linkerd-io",
"linkerd-meshtls",
"linkerd-meshtls-rustls",
"linkerd-retry",
"linkerd-tracing",
"parking_lot",
"pin-project",
Expand Down
2 changes: 0 additions & 2 deletions linkerd/app/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ linkerd-error-respond = { path = "../../error-respond" }
linkerd-exp-backoff = { path = "../../exp-backoff" }
linkerd-http-classify = { path = "../../http-classify" }
linkerd-http-metrics = { path = "../../http-metrics" }
linkerd-http-retry = { path = "../../http-retry" }
linkerd-identity = { path = "../../identity" }
linkerd-io = { path = "../../io" }
linkerd-meshtls = { path = "../../meshtls", default-features = false }
Expand All @@ -49,7 +48,6 @@ linkerd-proxy-tap = { path = "../../proxy/tap" }
linkerd-proxy-tcp = { path = "../../proxy/tcp" }
linkerd-proxy-transport = { path = "../../proxy/transport" }
linkerd-reconnect = { path = "../../reconnect" }
linkerd-retry = { path = "../../retry" }
linkerd-service-profiles = { path = "../../service-profiles" }
linkerd-stack = { path = "../../stack" }
linkerd-stack-metrics = { path = "../../stack/metrics" }
Expand Down
2 changes: 1 addition & 1 deletion linkerd/app/core/src/classify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ fn h2_error(err: &Error) -> String {
// === impl Class ===

impl Class {
pub(super) fn is_failure(&self) -> bool {
pub fn is_failure(&self) -> bool {
matches!(
self,
Class::Default(SuccessOrFailure::Failure)
Expand Down
1 change: 0 additions & 1 deletion linkerd/app/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ pub mod errors;
pub mod http_tracing;
pub mod metrics;
pub mod proxy;
pub mod retry;
pub mod serve;
pub mod svc;
pub mod telemetry;
Expand Down
2 changes: 2 additions & 0 deletions linkerd/app/outbound/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ bytes = "1"
http = "0.2"
futures = { version = "0.3", default-features = false }
linkerd-app-core = { path = "../core" }
linkerd-http-classify = { path = "../../http-classify" }
linkerd-http-retry = { path = "../../http-retry" }
linkerd-identity = { path = "../../identity" }
linkerd-retry = { path = "../../retry" }
parking_lot = "0.11"
thiserror = "1.0"
tokio = { version = "1", features = ["sync"] }
Expand Down
1 change: 1 addition & 0 deletions linkerd/app/outbound/src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ mod endpoint;
pub mod logical;
mod proxy_connection_close;
mod require_id_header;
mod retry;
mod server;
mod strip_proxy_error;

Expand Down
4 changes: 2 additions & 2 deletions linkerd/app/outbound/src/http/logical.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::{CanonicalDstHeader, Concrete, Endpoint, Logical};
use super::{retry, CanonicalDstHeader, Concrete, Endpoint, Logical};
use crate::{endpoint, resolve, stack_labels, Outbound};
use linkerd_app_core::{
classify, config, dst, profiles,
Expand All @@ -8,7 +8,7 @@ use linkerd_app_core::{
http,
resolve::map_endpoint,
},
retry, svc, Error, Infallible,
svc, Error, Infallible,
};
use tracing::debug_span;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
use super::classify;
use super::dst::Route;
use super::http_metrics::retries::Handle;
use super::metrics::HttpRouteRetry;
use crate::profiles;
use futures::future;
use linkerd_error::Error;
use linkerd_app_core::{
classify,
dst::Route,
http_metrics::retries::Handle,
metrics::HttpRouteRetry,
profiles,
proxy::http::{ClientHandle, HttpBody},
svc::{layer, Either, Param},
Error,
};
use linkerd_http_classify::{Classify, ClassifyEos, ClassifyResponse};
use linkerd_http_retry::ReplayBody;
use linkerd_proxy_http::ClientHandle;
use linkerd_retry as retry;
use linkerd_stack::{layer, Either, Param};
use std::sync::Arc;

pub fn layer<N>(
Expand Down Expand Up @@ -60,7 +62,7 @@ impl retry::NewPolicy<Route> for NewRetryPolicy {

impl<A, B, E> retry::Policy<http::Request<ReplayBody<A>>, http::Response<B>, E> for RetryPolicy
where
A: http_body::Body + Unpin,
A: HttpBody + Unpin,
A::Error: Into<Error>,
{
type Future = future::Ready<Self>;
Expand Down Expand Up @@ -125,7 +127,7 @@ where

impl<A, B, E> retry::PrepareRequest<http::Request<A>, http::Response<B>, E> for RetryPolicy
where
A: http_body::Body + Unpin,
A: HttpBody + Unpin,
A::Error: Into<Error>,
{
type RetryRequest = http::Request<ReplayBody<A>>;
Expand Down