mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-04 02:30:45 +00:00
fix(probe): restart conntrack handler periodically to clear out data
We observe a slow increase in connections reported, and are unable to find the root cause, so clear down the data every six hours and start from a clean sheet.
This commit is contained in:
@@ -135,16 +135,20 @@ func (c *conntrackWalker) run() {
|
||||
return
|
||||
}
|
||||
|
||||
defer log.Infof("conntrack exiting")
|
||||
|
||||
periodicRestart := time.After(6 * time.Hour)
|
||||
// Handle conntrack events from netlink socket
|
||||
for {
|
||||
select {
|
||||
case <-periodicRestart:
|
||||
log.Debugf("conntrack periodic restart")
|
||||
return
|
||||
case <-c.quit:
|
||||
log.Infof("conntrack quit signal - exiting")
|
||||
stop()
|
||||
return
|
||||
case f, ok := <-events:
|
||||
if !ok {
|
||||
log.Errorf("conntrack events read failed - exiting")
|
||||
return
|
||||
}
|
||||
if f.Err != nil {
|
||||
|
||||
Reference in New Issue
Block a user