mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 01:18:42 +00:00
Add continues to not crash with panics on connection errors (#14223)
I found a few panics in osquery-perf while working in load testing #13287. These panic happened due to e.g. network errors.
This commit is contained in:
parent
d108147ec0
commit
71a237042a
1 changed files with 5 additions and 0 deletions
|
|
@ -551,6 +551,7 @@ func (a *agent) runOrbitLoop() {
|
|||
if err != nil {
|
||||
a.stats.IncrementOrbitErrors()
|
||||
log.Println("orbitClient.GetConfig: ", err)
|
||||
continue
|
||||
}
|
||||
if len(cfg.Notifications.PendingScriptExecutionIDs) > 0 {
|
||||
// there are pending scripts to execute on this host, start a goroutine
|
||||
|
|
@ -562,6 +563,7 @@ func (a *agent) runOrbitLoop() {
|
|||
if err := deviceClient.CheckToken(*a.deviceAuthToken); err != nil {
|
||||
a.stats.IncrementOrbitErrors()
|
||||
log.Println("deviceClient.CheckToken: ", err)
|
||||
continue
|
||||
}
|
||||
}
|
||||
case <-orbitTokenRotationTicker:
|
||||
|
|
@ -570,6 +572,7 @@ func (a *agent) runOrbitLoop() {
|
|||
if err := orbitClient.SetOrUpdateDeviceToken(*newToken); err != nil {
|
||||
a.stats.IncrementOrbitErrors()
|
||||
log.Println("orbitClient.SetOrUpdateDeviceToken: ", err)
|
||||
continue
|
||||
}
|
||||
a.deviceAuthToken = newToken
|
||||
// fleet desktop performs a burst of check token requests after a token is rotated
|
||||
|
|
@ -579,11 +582,13 @@ func (a *agent) runOrbitLoop() {
|
|||
if err := orbitClient.Ping(); err != nil {
|
||||
a.stats.IncrementOrbitErrors()
|
||||
log.Println("orbitClient.Ping: ", err)
|
||||
continue
|
||||
}
|
||||
case <-fleetDesktopPolicyTicker:
|
||||
if _, err := deviceClient.DesktopSummary(*a.deviceAuthToken); err != nil {
|
||||
a.stats.IncrementDesktopErrors()
|
||||
log.Println("deviceClient.NumberOfFailingPolicies: ", err)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue