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

Refactor AdsClient and switch backoff with tryhard #430

Merged
merged 3 commits into from
Nov 3, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ test = true
quilkin-macros = { version = "0.3.0-dev", path = "./macros" }

# Crates.io
backoff = "0.3.0"
base64 = "0.13.0"
base64-serde = "0.6.1"
bytes = "1.1.0"
Expand All @@ -68,6 +67,7 @@ tokio-stream = "0.1.7"
tonic = "0.5.2"
uuid = { version = "0.8.2", default-features = false, features = ["v4"] }
thiserror = "1.0.30"
tryhard = "0.4.0"
eyre = "0.6.5"
stable-eyre = "0.2.2"
ipnetwork = "0.18.0"
Expand Down
1 change: 1 addition & 0 deletions src/filters/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub struct FilterManager {
}

/// ListenerManagerArgs contains arguments when invoking the LDS resource manager.
#[derive(Clone)]
pub(crate) struct ListenerManagerArgs {
pub filter_chain_updates_tx: mpsc::Sender<Arc<FilterChain>>,
pub filter_registry: FilterRegistry,
Expand Down
8 changes: 4 additions & 4 deletions src/proxy/server/resource_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::{
manager::{FilterManager, ListenerManagerArgs, SharedFilterManager},
FilterChain, FilterRegistry,
},
xds::ads_client::{AdsClient, ClusterUpdate, ExecutionResult, UPDATES_CHANNEL_BUFFER_SIZE},
xds::ads_client::{AdsClient, ClusterUpdate, UPDATES_CHANNEL_BUFFER_SIZE},
};
use prometheus::Registry;
use slog::{o, warn, Logger};
Expand All @@ -39,7 +39,7 @@ pub(super) struct StaticResourceManagers {
pub(super) struct DynamicResourceManagers {
pub(super) cluster_manager: SharedClusterManager,
pub(super) filter_manager: SharedFilterManager,
pub(super) execution_result_rx: oneshot::Receiver<ExecutionResult>,
pub(super) execution_result_rx: oneshot::Receiver<crate::Result<()>>,
}

impl StaticResourceManagers {
Expand All @@ -64,7 +64,7 @@ struct SpawnAdsClient {
management_servers: Vec<ManagementServer>,
cluster_updates_tx: mpsc::Sender<ClusterUpdate>,
listener_manager_args: ListenerManagerArgs,
execution_result_tx: oneshot::Sender<ExecutionResult>,
execution_result_tx: oneshot::Sender<crate::Result<()>>,
shutdown_rx: watch::Receiver<()>,
}

Expand All @@ -89,7 +89,7 @@ impl DynamicResourceManagers {
filter_chain_updates_tx,
);

let (execution_result_tx, execution_result_rx) = oneshot::channel::<ExecutionResult>();
let (execution_result_tx, execution_result_rx) = oneshot::channel::<crate::Result<()>>();
Self::spawn_ads_client(SpawnAdsClient {
log: log.clone(),
metrics_registry: metrics_registry.clone(),
Expand Down
Loading