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

Allow service initialization to fail #1096

Merged
merged 2 commits into from
Feb 5, 2025
Merged
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
17 changes: 8 additions & 9 deletions src/cli/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,16 +233,15 @@ impl Service {
shutdown_rx: &crate::signal::ShutdownRx,
) -> crate::Result<tokio::task::JoinHandle<crate::Result<()>>> {
let shutdown_rx = shutdown_rx.clone();
let config = config.clone();
Ok(tokio::spawn(async move {
let mds_task = self.publish_mds(&config)?;
let phoenix_task = self.publish_phoenix(&config, &shutdown_rx)?;
// We need to call this before qcmp since if we use XDP we handle QCMP
// internally without a separate task
let (udp_task, finalizer) = self.publish_udp(&config)?;
let qcmp_task = self.publish_qcmp(&shutdown_rx)?;
let xds_task = self.publish_xds(&config)?;
let mds_task = self.publish_mds(config)?;
let phoenix_task = self.publish_phoenix(config, &shutdown_rx)?;
// We need to call this before qcmp since if we use XDP we handle QCMP
// internally without a separate task
let (udp_task, finalizer) = self.publish_udp(config)?;
let qcmp_task = self.publish_qcmp(&shutdown_rx)?;
let xds_task = self.publish_xds(config)?;

Ok(tokio::spawn(async move {
let result = tokio::select! {
result = mds_task => result,
result = phoenix_task => result,
Expand Down
Loading