Skip to content

CRITICAL: Async function invocation never tracked - data loss risk #673

Description

@poyrazK

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

  • Small
  • Medium
  • Large

Severity

  • Low
  • Medium
  • High
  • Critical

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions