Phase 9 R1: repo-ensure RPC + fleet-health fixes #107
+17
-17
@@ -7,7 +7,7 @@ use crate::manifest::Manifest;
|
||||
use crate::snapshot;
|
||||
use crate::sync::{SyncQueue, drain_sync_queue};
|
||||
use crate::zfs::SystemZfs;
|
||||
use anyhow::Result;
|
||||
use anyhow::{Context, Result};
|
||||
use chrono::Utc;
|
||||
use sysinfo::{ProcessRefreshKind, RefreshKind, System};
|
||||
use tokio::time::{interval, Duration};
|
||||
@@ -36,7 +36,14 @@ pub async fn run(cfg: Config, mut manifest: Manifest) -> Result<()> {
|
||||
let hot_dir = cfg.hot.path.clone();
|
||||
let hot_max_bytes = cfg.hot.max_gb.saturating_mul(1024 * 1024 * 1024);
|
||||
let blob_root = cluster_cfg.blob_store_root.clone();
|
||||
match ClusterServices::start(
|
||||
// Fail fast rather than degrade silently: a bind failure here is
|
||||
// almost always a boot-time race against DHCP/network-online
|
||||
// (the bind address isn't assigned to the interface yet). The
|
||||
// systemd unit has `Restart=on-failure`; exiting lets it retry
|
||||
// a few seconds later once the network is actually up, instead
|
||||
// of leaving the daemon running indefinitely with no gossip,
|
||||
// RPC, or Prometheus endpoint and no visible failure state.
|
||||
let svc = ClusterServices::start(
|
||||
cluster_cfg,
|
||||
cfg.node.name.clone(),
|
||||
hot_dir,
|
||||
@@ -44,21 +51,14 @@ pub async fn run(cfg: Config, mut manifest: Manifest) -> Result<()> {
|
||||
blob_root,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok(svc) => {
|
||||
tracing::info!(
|
||||
rpc_enabled = svc.rpc_enabled(),
|
||||
blob_store_enabled = svc.blob_store_enabled(),
|
||||
zone = %cluster_cfg.zone,
|
||||
"cluster services online"
|
||||
);
|
||||
Some(svc)
|
||||
}
|
||||
Err(e) => {
|
||||
tracing::error!(error = %e, "cluster services failed to start; continuing without cluster");
|
||||
None
|
||||
}
|
||||
}
|
||||
.context("starting cluster services")?;
|
||||
tracing::info!(
|
||||
rpc_enabled = svc.rpc_enabled(),
|
||||
blob_store_enabled = svc.blob_store_enabled(),
|
||||
zone = %cluster_cfg.zone,
|
||||
"cluster services online"
|
||||
);
|
||||
Some(svc)
|
||||
}
|
||||
None => {
|
||||
tracing::info!("no [cluster] section in config; running standalone");
|
||||
|
||||
Reference in New Issue
Block a user