fix issue with closing flush signal channel (#7384)
This commit is contained in:
@@ -556,6 +556,7 @@ func (a *Agent) flushLoop(
|
||||
// watch for flush requests
|
||||
flushRequested := make(chan os.Signal, 1)
|
||||
watchForFlushSignal(flushRequested)
|
||||
defer stopListeningForFlushSignal(flushRequested)
|
||||
|
||||
// align to round interval
|
||||
if a.Config.Agent.RoundInterval {
|
||||
|
||||
@@ -12,5 +12,8 @@ const flushSignal = syscall.SIGUSR1
|
||||
|
||||
func watchForFlushSignal(flushRequested chan os.Signal) {
|
||||
signal.Notify(flushRequested, flushSignal)
|
||||
}
|
||||
|
||||
func stopListeningForFlushSignal(flushRequested chan os.Signal) {
|
||||
defer signal.Stop(flushRequested)
|
||||
}
|
||||
@@ -5,5 +5,9 @@ package agent
|
||||
import "os"
|
||||
|
||||
func watchForFlushSignal(flushRequested chan os.Signal) {
|
||||
// not implemented
|
||||
// not supported
|
||||
}
|
||||
|
||||
func stopListeningForFlushSignal(flushRequested chan os.Signal) {
|
||||
// not supported
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user