MCPcopy Index your code
hub / github.com/netdata/netdata / waitWorkers

Method waitWorkers

src/go/plugin/framework/functions/manager.go:243–263  ·  view source on GitHub ↗
(workersWG *sync.WaitGroup)

Source from the content-addressed store, hash-verified

241}
242
243func (m *Manager) waitWorkers(workersWG *sync.WaitGroup) bool {
244 if workersWG == nil {
245 return false
246 }
247
248 drainCtx, cancelDrain := context.WithTimeout(context.Background(), m.shutdownDrainTimeout)
249 defer cancelDrain()
250
251 done := make(chan struct{})
252 go func() {
253 defer close(done)
254 workersWG.Wait()
255 }()
256
257 select {
258 case <-done:
259 return false
260 case <-drainCtx.Done():
261 return true
262 }
263}
264
265func (m *Manager) finalizeUnresolvedOnShutdown(cancelInflight, timedOut bool) {
266 if !cancelInflight {

Callers 1

shutdownMethod · 0.95

Calls 1

WaitMethod · 0.65

Tested by

no test coverage detected