Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions ant-cli/src/commands/node/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,13 @@ impl StatusArgs {
NodeStatus::Starting => format!("{} {}", "●".yellow(), "Starting".yellow()),
NodeStatus::Stopping => format!("{} {}", "●".yellow(), "Stopping".yellow()),
NodeStatus::Errored => format!("{} {}", "●".red(), "Errored".red()),
NodeStatus::UpgradeScheduled => {
format!("{} {}", "●".cyan(), "Upgrade scheduled".cyan())
}
NodeStatus::Evicted => format!("{} {}", "●".magenta(), "Evicted".magenta()),
};
let version_display = match &node.pending_version {
Some(pending) => format!("{} → {}", node.version, pending),
None => node.version.clone(),
};
println!(
" {:<4} {:<14} {:<18} {}",
node.node_id.to_string().bold(),
node.name,
version_display.dimmed(),
node.version.dimmed(),
status_display
);
// Supplementary text explaining an eviction, plus how to clear it.
Expand Down
30 changes: 7 additions & 23 deletions ant-core/src/node/daemon/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ use crate::error::Result;
use crate::node::binary::NoopProgress;
use crate::node::daemon::health::{DiskThresholds, FleetHealth};
use crate::node::daemon::supervisor::{
spawn_eviction_monitor, spawn_liveness_monitor, spawn_upgrade_monitor, Supervisor,
EVICTION_POLL_INTERVAL, LIVENESS_POLL_INTERVAL, UPGRADE_POLL_INTERVAL,
spawn_eviction_monitor, spawn_liveness_monitor, Supervisor, EVICTION_POLL_INTERVAL,
LIVENESS_POLL_INTERVAL,
};
use crate::node::events::NodeEvent;
use crate::node::registry::NodeRegistry;
Expand Down Expand Up @@ -98,16 +98,6 @@ pub async fn start(
health: health.clone(),
});

// Background task: probe each Running node's on-disk binary for version drift caused by
// ant-node's auto-upgrade, and flip them to UpgradeScheduled so the supervisor knows the
// next exit is expected.
spawn_upgrade_monitor(
registry.clone(),
supervisor.clone(),
UPGRADE_POLL_INTERVAL,
shutdown.clone(),
);

// Background task: monitor free disk space at node data directories. Refreshes the fleet health
// snapshot every tick and auto-evicts a node (smallest data dir) on any partition that has
// fallen to the eviction threshold while ≥2 nodes remain. The threshold is a fixed internal
Expand Down Expand Up @@ -258,19 +248,16 @@ async fn get_nodes_status(State(state): State<Arc<AppState>>) -> Json<NodeStatus
};

match status {
NodeStatus::Running | NodeStatus::Starting | NodeStatus::UpgradeScheduled => {
total_running += 1
}
NodeStatus::Running | NodeStatus::Starting => total_running += 1,
_ => total_stopped += 1,
}

let (pid, uptime_secs, pending_version) = if config.eviction.is_some() {
(None, None, None)
let (pid, uptime_secs) = if config.eviction.is_some() {
(None, None)
} else {
(
supervisor.node_pid(config.id),
supervisor.node_uptime_secs(config.id),
supervisor.node_pending_version(config.id),
)
};

Expand All @@ -281,7 +268,6 @@ async fn get_nodes_status(State(state): State<Arc<AppState>>) -> Json<NodeStatus
status,
pid,
uptime_secs,
pending_version,
eviction: config.eviction.clone(),
});
}
Expand Down Expand Up @@ -311,14 +297,13 @@ async fn get_node_detail(

let supervisor = state.supervisor.read().await;
// A persisted eviction marker takes precedence over any runtime status.
let (status, pid, uptime_secs, pending_version) = if config.eviction.is_some() {
(NodeStatus::Evicted, None, None, None)
let (status, pid, uptime_secs) = if config.eviction.is_some() {
(NodeStatus::Evicted, None, None)
} else {
(
supervisor.node_status(id).unwrap_or(NodeStatus::Stopped),
supervisor.node_pid(id),
supervisor.node_uptime_secs(id),
supervisor.node_pending_version(id),
)
};

Expand All @@ -327,7 +312,6 @@ async fn get_node_detail(
status,
pid,
uptime_secs,
pending_version,
}))
}

Expand Down
Loading
Loading