container stats: bound hive-c0re's wait for the disk measurement, no total for an agent with no paths
hive-c0re waited on hive-priv's answer with no timeout, so a hung hive-priv would stall the disk sampler indefinitely. The wait is now hive-priv's own 10 min bound plus a minute (the bound is shared as MEASURE_AGENT_DISK_TIMEOUT); a timeout is an error, so the agent shows unknown. An agent with none of state/, work/ or the rootfs has no measurable size. hive-priv now answers with an error for it instead of a total of 0, which read as a real measurement.
This commit is contained in:
parent
98ccc31e2b
commit
960cf9ce30
3 changed files with 131 additions and 36 deletions
|
|
@ -291,6 +291,11 @@ pub struct NetworkIsolation {
|
|||
pub gateway_ip: String,
|
||||
}
|
||||
|
||||
/// Wall-clock bound hive-priv puts on one [`PrivRequest::MeasureAgentDisk`]
|
||||
/// walk. A caller's own wait has to be longer than this, so a slow walk
|
||||
/// reaches it as hive-priv's timeout error rather than as its own.
|
||||
pub const MEASURE_AGENT_DISK_TIMEOUT: std::time::Duration = std::time::Duration::from_mins(10);
|
||||
|
||||
/// A request to the privileged helper.
|
||||
///
|
||||
/// Wire format: one JSON object per line over `/run/hive/priv.sock`.
|
||||
|
|
@ -565,7 +570,8 @@ pub enum PrivRequest {
|
|||
/// bytes as a decimal string in `stdout`.
|
||||
///
|
||||
/// hive-priv derives all three paths from `agent_name`; the request
|
||||
/// carries no path. A path that doesn't exist is skipped. A timeout, a
|
||||
/// carries no path. A path that doesn't exist is skipped; an agent with
|
||||
/// none of the three has no measurable size and gets an error. A timeout, a
|
||||
/// non-zero `du` exit or unparseable output is an error, never a partial
|
||||
/// or zero total. Requires root: `hive-core` cannot read the rootfs or
|
||||
/// the agent-owned files under `state/` and `work/`.
|
||||
|
|
|
|||
Loading…
Reference in a new issue