A dry run does not refresh live state, so say that rather than showing its age as stale
This commit is contained in:
@@ -427,13 +427,21 @@ function _daemonRow(p, checkInterval) {
|
|||||||
// intervals is a wedged process or a dead one — and the state value it left behind is a claim
|
// intervals is a wedged process or a dead one — and the state value it left behind is a claim
|
||||||
// about the past, not the present.
|
// about the past, not the present.
|
||||||
function _freshness(node, checkInterval) {
|
function _freshness(node, checkInterval) {
|
||||||
const a = node.state_age;
|
const a = node.state_age;
|
||||||
|
// A dry run redirects its state writes to a per-PID copy so the live file is never touched.
|
||||||
|
// That is the point of it — but it means the live file goes on ageing while a preview runs,
|
||||||
|
// and "daemon: dry run" beside "state age: 5d — stale" reads as a fault when it is the
|
||||||
|
// designed behaviour. Say which it is rather than leaving the operator to chase it.
|
||||||
|
const dry = node.proc && node.proc.running && node.proc.mode === 'dry-run';
|
||||||
|
|
||||||
if (a === null || a === undefined) {
|
if (a === null || a === undefined) {
|
||||||
|
if (dry) return ['dim', 'none — dry run does not write live state'];
|
||||||
return node.is_me
|
return node.is_me
|
||||||
? ['bad', 'no state file — fallback has never run here']
|
? ['bad', 'no state file — fallback has never run here']
|
||||||
: ['dim', 'not readable from here'];
|
: ['dim', 'not readable from here'];
|
||||||
}
|
}
|
||||||
const limit = Math.max(120, (checkInterval || 30) * 4);
|
const limit = Math.max(120, (checkInterval || 30) * 4);
|
||||||
|
if (a > limit && dry) return ['dim', _age(a) + ' — not refreshed: dry run writes elsewhere'];
|
||||||
return [a > limit ? 'bad' : 'good', _age(a) + (a > limit ? ' — stale' : '')];
|
return [a > limit ? 'bad' : 'good', _age(a) + (a > limit ? ' — stale' : '')];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -495,7 +503,7 @@ function _nodeCard(node, data) {
|
|||||||
<span class="vv-fb-hnm">${vvEscHtml(node.hostname)}</span>
|
<span class="vv-fb-hnm">${vvEscHtml(node.hostname)}</span>
|
||||||
${node.is_me ? '<span class="vv-fb-usbadge">US</span>' : ''}
|
${node.is_me ? '<span class="vv-fb-usbadge">US</span>' : ''}
|
||||||
<span style="flex:1"></span>
|
<span style="flex:1"></span>
|
||||||
${(node.is_me && fCls !== 'bad') ? _ptStatus(st) : ''}
|
${(node.is_me && fCls === 'good') ? _ptStatus(st) : ''}
|
||||||
${_stateBadge(state)}
|
${_stateBadge(state)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user