From 58ccf4456773b1c7cb9c2143d4d72353fdd933b1 Mon Sep 17 00:00:00 2001 From: Jake Shadle Date: Thu, 22 Aug 2024 11:38:49 +0200 Subject: [PATCH] Don't panic if there are no updates available (#1008) --- crates/xds/src/server.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/xds/src/server.rs b/crates/xds/src/server.rs index 308767c02..eefc74ad2 100644 --- a/crates/xds/src/server.rs +++ b/crates/xds/src/server.rs @@ -282,7 +282,14 @@ impl ControlPlane { Err(tokio::sync::broadcast::error::RecvError::Lagged(_)) => { let tracked_resources: Vec<_> = client_tracker.tracked_resources().collect(); for rt in tracked_resources { - yield responder(None, &rt, &mut client_tracker)?.unwrap(); + match responder(None, &rt, &mut client_tracker) { + Ok(Some(res)) => yield res, + Ok(None) => {}, + Err(error) => { + tracing::error!(%error, "responder failed to generate response"); + continue; + } + } } } }