mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-05-23 04:12:46 +00:00
Record poll error in PVE/PBS/PMG poll-result trackers
The deferred recordTaskResult call was passing pollErr as a function argument, so it captured the value at defer-time (always nil) instead of the value at execution time. Result: the per-instance pollStatusMap treated every poll as a success — LastSuccess was set to "now" on every cycle, ConsecutiveFailures stayed at zero, and the circuit breaker never opened, even when the staleness tracker (which used a proper closure) recorded the same poll as a failure. The connections aggregator derives state from PollStatus.LastSuccess, so the Connections UI reported broken PVE/PBS/PMG instances as "active / verified / healthy" while no data was ingested. Wrap the recordTaskResult call in a defer closure so it reads the live pollErr at execution time, matching the pollMetrics and stalenessTracker defers immediately above.
This commit is contained in:
parent
1cc20d5768
commit
bf6261adc6
2 changed files with 9 additions and 3 deletions
|
|
@ -93,7 +93,9 @@ func (m *Monitor) pollPBSInstance(ctx context.Context, instanceName string, clie
|
|||
}
|
||||
}()
|
||||
}
|
||||
defer m.recordTaskResult(InstanceTypePBS, instanceName, pollErr)
|
||||
defer func() {
|
||||
m.recordTaskResult(InstanceTypePBS, instanceName, pollErr)
|
||||
}()
|
||||
|
||||
// Check if context is cancelled
|
||||
select {
|
||||
|
|
@ -479,7 +481,9 @@ func (m *Monitor) pollPMGInstance(ctx context.Context, instanceName string, clie
|
|||
}
|
||||
}()
|
||||
}
|
||||
defer m.recordTaskResult(InstanceTypePMG, instanceName, pollErr)
|
||||
defer func() {
|
||||
m.recordTaskResult(InstanceTypePMG, instanceName, pollErr)
|
||||
}()
|
||||
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
|
|
|
|||
|
|
@ -989,7 +989,9 @@ func (m *Monitor) pollPVEInstance(ctx context.Context, instanceName string, clie
|
|||
}
|
||||
}()
|
||||
}
|
||||
defer m.recordTaskResult(InstanceTypePVE, instanceName, pollErr)
|
||||
defer func() {
|
||||
m.recordTaskResult(InstanceTypePVE, instanceName, pollErr)
|
||||
}()
|
||||
|
||||
// Check if context is cancelled
|
||||
select {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue