From 203dc3658e1aad0aa6d271b3213c347f0aa3c6a5 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 23 Sep 2026 20:11:26 +0200 Subject: [PATCH] Retry the initial Active presence through Odin's correlation gap Odin refuses Active until it has correlated the lease Idunn just granted ("Ready topology state is not supported by correlated evidence"); the first v2 candidate to get past Warming and the lease died on that single refusal. Retry it with the helper and window the Warming publish already uses; the periodic republish already only logs. The cadence constant now names both presences. Co-Authored-By: Claude Opus 5.5 --- crates/ghostlight-dungeon/src/runtime.rs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/crates/ghostlight-dungeon/src/runtime.rs b/crates/ghostlight-dungeon/src/runtime.rs index 136b3c6..d83d426 100644 --- a/crates/ghostlight-dungeon/src/runtime.rs +++ b/crates/ghostlight-dungeon/src/runtime.rs @@ -460,9 +460,20 @@ pub(crate) async fn run(state_root_binding: Option) -> anyhow::Result<( let write_lease = write_lease_guard .as_ref() .context("production runtime lost its process write lease")?; - publisher - .publish_active(write_lease) - .context("publishing initial active runtime presence")?; + // Odin refuses Active until it has correlated the lease Idunn just + // granted ("Ready topology state is not supported by correlated + // evidence"), the same publication gap the initial Warming publish + // retries through. Each call is a fresh sequenced message; the lease + // it names cannot change between attempts (`publish_active`). + retry_until_deadline( + || publisher.publish_active(write_lease), + INITIAL_PRESENCE_RETRY_CADENCE, + Instant::now() + WRITE_LEASE_WAIT_TIMEOUT, + "publishing initial active runtime presence", + Instant::now, + |duration| tokio::time::sleep(duration), + ) + .await?; } require_current_write_lease(write_lease_guard.as_ref())?; state.runtime_health = match (idunn_health, write_lease_guard) { @@ -1928,7 +1939,7 @@ const WRITE_LEASE_WAIT_TIMEOUT: Duration = Duration::from_secs(120); /// Muninn re-publishes its own Warming presence every 2s while tolerating /// this same activation-publication gap (Muninn/crates/muninn-daemon/src/main.rs); /// the initial-publish retry below matches that cadence. -const INITIAL_WARMING_RETRY_CADENCE: Duration = Duration::from_secs(2); +const INITIAL_PRESENCE_RETRY_CADENCE: Duration = Duration::from_secs(2); /// Retries `attempt` at `cadence` until it returns `Ok` or `deadline` passes, /// warning on every failed attempt and returning the last error once the @@ -1974,7 +1985,7 @@ async fn initialize_production_admission( // drops. let warming = retry_until_deadline( || publisher.publish_warming(), - INITIAL_WARMING_RETRY_CADENCE, + INITIAL_PRESENCE_RETRY_CADENCE, Instant::now() + WRITE_LEASE_WAIT_TIMEOUT, "publishing initial Warming runtime presence", Instant::now,