From be50dc32359726eff094332ec8036f60bb4b8bee Mon Sep 17 00:00:00 2001 From: Dorian Date: Thu, 14 May 2026 00:03:16 -0400 Subject: [PATCH] fix: avoid bootstrap bitcoin restarts --- core/archipelago/src/bootstrap.rs | 16 ++++++---------- core/archipelago/src/health_monitor.rs | 8 ++++++++ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/core/archipelago/src/bootstrap.rs b/core/archipelago/src/bootstrap.rs index 399998b0..72499f3b 100644 --- a/core/archipelago/src/bootstrap.rs +++ b/core/archipelago/src/bootstrap.rs @@ -65,7 +65,7 @@ pub async fn ensure_doctor_installed() { Err(e) => warn!("Nginx bootstrap failed (non-fatal): {:#}", e), } match run_bitcoin_rpc_repair().await { - Ok(true) => info!("Repaired Bitcoin RPC bind settings and restarted Bitcoin containers"), + Ok(true) => info!("Repaired Bitcoin RPC bind settings; running Bitcoin containers left untouched"), Ok(false) => debug!("Bitcoin RPC bind settings already usable"), Err(e) => warn!("Bitcoin RPC repair failed (non-fatal): {:#}", e), } @@ -334,15 +334,11 @@ exit 2 .context("repair bitcoin.conf RPC bind settings")?; match status.code() { Some(0) => Ok(false), - Some(2) => { - for name in ["bitcoin-knots", "bitcoin-core", "archy-bitcoin-ui"] { - let _ = tokio::process::Command::new("podman") - .args(["restart", name]) - .status() - .await; - } - Ok(true) - } + // Do not restart Bitcoin from bootstrap. During IBD, an automatic + // restart can cost hours of progress. The repaired file is only a + // fallback for future starts; current containers keep their command-line + // RPC args until an operator or update intentionally restarts them. + Some(2) => Ok(true), _ => { warn!("Bitcoin RPC repair helper exited with {}", status); Ok(false) diff --git a/core/archipelago/src/health_monitor.rs b/core/archipelago/src/health_monitor.rs index 53d3537f..3d5cc456 100644 --- a/core/archipelago/src/health_monitor.rs +++ b/core/archipelago/src/health_monitor.rs @@ -776,6 +776,14 @@ pub fn spawn_health_monitor(state: Arc, data_dir: PathBuf) { } if container.healthy { + let before = data.notifications.len(); + data.notifications.retain(|n| { + n.app_id.as_deref() != Some(&container.app_id) + && !n.title.contains(&container.app_id) + }); + if data.notifications.len() != before { + state_changed = true; + } if tracker.attempt_count(&container.name) > 0 { info!( "Container {} is healthy again after restart",