(event inputEvent)
| 441 | } |
| 442 | |
| 443 | func (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 | |
| 465 | func (m *Manager) requestCancellation(uid string) (invocationState, bool) { |
| 466 | m.invStateMux.Lock() |
no test coverage detected