Why is this an issue?
In internal/core/services/function.go:284-300, async function invocations return immediately with PENDING status but the goroutine never updates the invocation record in DB. The async operation can fail silently with no tracking.
What is causing it?
if async {
go func() {
if _, err := s.runInvocation(bgCtx, f, &asyncInv, payload); err != nil {
s.logger.Error("async invocation failed", ...)
}
}()
return invocation, nil // Returned immediately - DB never updated
}
How can it be solved?
- Track async invocations in DB before returning
- Implement proper state machine with terminal states (COMPLETED/FAILED)
- Add retry mechanism with dead letter queue
Category
Severity
Why is this an issue?
In
internal/core/services/function.go:284-300, async function invocations return immediately with PENDING status but the goroutine never updates the invocation record in DB. The async operation can fail silently with no tracking.What is causing it?
How can it be solved?
Category
Severity