Watch
0
0
Fork
You've already forked hyperhive
0

swarm-controller: update_meta waits up to 60s for the queue client to connect

The boot run of the UpdateMeta node read hive placements before the queue client had connected, failed on the Pending client, and was not declared again until the next 10 minute timer tick. It now waits for the connection, bounded to 60s, and fails with a message naming the wait when the queue never connects. agent_renewal's wait_for_queue takes the bound as a parameter so both callers share it.
This commit is contained in:
atlas 2026-11-07 14:13:15 +01:00 • committed by mara
commit 3b007b1ccb

View file

@ -382,9 +382,12 @@ async fn observe_all(
}
/// Wait until `connected` holds, checking every [`CONNECT_POLL`] for at most
/// [`RECONCILE_INTERVAL`]. Returns whether it held.
async fn wait_for_queue(connected: impl Fn() -> bool) -> bool {
let deadline = tokio::time::Instant::now() + RECONCILE_INTERVAL;
/// `bound`. Returns whether it held.
pub(crate) async fn wait_for_queue(
connected: impl Fn() -> bool,
bound: std::time::Duration,
) -> bool {
let deadline = tokio::time::Instant::now() + bound;
loop {
if connected() {
return true;
@ -402,7 +405,7 @@ where
P: FnMut() -> F,
F: std::future::Future<Output = Result<Vec<(String, AgentObserved)>>>,
{
if !wait_for_queue(connected).await {
if !wait_for_queue(connected, RECONCILE_INTERVAL).await {
tracing::warn!(
waited_s = RECONCILE_INTERVAL.as_secs(),
"agent credential renewal: queue still not connected; running the first pass anyway"