-
Problem report
-
Resolution: Fixed
-
Trivial
-
4.4.3
-
None
-
Sprint 59 (Dec 2019)
-
0.25
When executing single passive checks client creates unbuffered output channel, sends request to scheduler and waits for timeout seconds for the result (see the code fragment below). After timeout there are no readers for the output channel anymore, which causes check to be stuck when writing back result/error.
To fix:
1. create buffered (1) channel so plugin could write the response even with no readers listening.
2. use larger timeout (1 minute). The plugin/scheduler must handle the timeout anyway, so here timeout handling is somewhat redundant.
func (m *Manager) PerformTask(key string, timeout time.Duration) (result string, err error) { var lastLogsize uint64 var mtime int w := make(resultWriter) m.UpdateTasks(0, w, 0, nil, []*plugin.Request{{Key: key, LastLogsize: &lastLogsize, Mtime: &mtime}}) select { case r := <-w: if r.Error == nil { if r.Value != nil { result = *r.Value } else { // single metric requests do not support empty values, return error instead err = errors.New("No values have been gathered yet.") } } else { err = r.Error } case <-time.After(timeout): err = fmt.Errorf("Timeout occurred while gathering data.") } return }
- part of
-
ZBX-21703 Zabbix Agent2 is no longer retrieving Windows perfmon counters after a period of time
- Reopened