MCPcopy
hub / github.com/netdata/netdata / handleCancelEvent

Method handleCancelEvent

src/go/plugin/framework/functions/manager.go:443–463  ·  view source on GitHub ↗
(event inputEvent)

Source from the content-addressed store, hash-verified

441}
442
443func (m *Manager) handleCancelEvent(event inputEvent) {
444 uid := event.uid
445 if uid == "" {
446 return
447 }
448
449 if event.preAdmission {
450 m.respUID(uid, 499, "request canceled")
451 return
452 }
453
454 if _, ok := m.requestCancellation(uid); !ok {
455 m.Debugf("ignoring cancel for unknown transaction id: %s", uid)
456 return
457 }
458 // No immediate terminal response. requestCancellation handled state
459 // transitions: for queued functions the cancel is intentionally ignored
460 // (function will run to completion); for running/awaiting functions a
461 // fallback timer was armed and will emit 499 + tombstone after
462 // cancelFallbackDelay.
463}
464
465func (m *Manager) requestCancellation(uid string) (invocationState, bool) {
466 m.invStateMux.Lock()

Callers 1

runMethod · 0.95

Calls 3

respUIDMethod · 0.95
requestCancellationMethod · 0.95
DebugfMethod · 0.65

Tested by

no test coverage detected