Merge pull request #1987 from balena-os/prevent-restart-on-report-error

Disable healthchecks failing on report errors
This commit is contained in:
bulldozer-balena[bot] 2022-07-18 20:47:19 +00:00 committed by GitHub
commit 944d76fde0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,12 @@ import { shallowDiff, prune, empty } from '../lib/json';
let lastReport: DeviceState = {}; let lastReport: DeviceState = {};
let lastReportTime: number = -Infinity; let lastReportTime: number = -Infinity;
// TODO: This counter is read by the healthcheck to see if the
// supervisor is having issues to connect. We have removed the
// lines of code to increase the counter on network error as
// we suspect that is really making things worst. This will
// most likely get removed in the future.
export let stateReportErrors = 0; export let stateReportErrors = 0;
type StateReportOpts = { type StateReportOpts = {
@ -119,10 +125,6 @@ function handleRetry(retryInfo: OnFailureInfo) {
eventTracker.track('Device state report failure', { eventTracker.track('Device state report failure', {
error: retryInfo.error?.message ?? retryInfo.error, error: retryInfo.error?.message ?? retryInfo.error,
}); });
// Increase the counter so the healthcheck gets triggered
// if too many connectivity errors occur
stateReportErrors++;
} }
log.info( log.info(
`Retrying current state report in ${retryInfo.delay / 1000} seconds`, `Retrying current state report in ${retryInfo.delay / 1000} seconds`,