Skip to content

fix(iac): default Lambda timeout (30s) is shorter than detached in-process budgets #913

Closed

Description

@cristim

Problem

#897 detaches ExecuteExchange from the request context with a 4-minute budget (ctxutil.DetachedWithTimeout). #895 gives HTTP-triggered scheduled tasks a 300s budget. On the default AWS Lambda deployment the function timeout is 30s (timeout default 30 in terraform/modules/compute/aws/lambda/variables.tf:51-55, fed from the root lambda_timeout in terraform/environments/aws/variables.tf:231-235, also default 30). Lambda kills the invocation at 30s whatever the context deadline says, so on that deployment the detached work still stops at 30s. An RI exchange or scheduled task that needs longer is cut off mid-flight.

#789 had the same limitation, so #897 did not introduce it. Nothing in the Terraform enforces a minimum lambda_timeout that matches the in-process budgets.

Expected

The Lambda timeout for the API/scheduler function is at least the longest in-process budget plus a margin (for example >= 270s for the 4-minute exchange path, or the 300s task bound). Alternatively, a validation check fails the plan when lambda_timeout is below it.

Repro

  1. Read the default timeout in terraform/modules/compute/aws/lambda/variables.tf:51-55 (30) and the root lambda_timeout that feeds it.
  2. Compare it with the 4m budget used by the RI exchange handler after fix(ri-exchange): run ExecuteExchange outside the request context #897, and the 300s scheduled-task bound after fix(server): detach HTTP-triggered scheduled tasks from the request context #895.

No real-account repro was run.

Suggested fix

Raise the default, add a Terraform validation block (or a Go test in terraform/modules/compute like the scheduled-task wiring tests) that pins lambda_timeout >= the in-process budget, and document the coupling next to the constant.

Follow-up from the #897 review; tracked separately at the owner's request, not a blocker for #897.

Activity

  1. IAmJSD commented on Oct 16, 2026

    @IAmJSD
    Collaborator

    Claiming: working on this

  2. self-assigned this
    on Oct 16, 2026
  3. added a commit that references this issue on Oct 17, 2026
    3a1879c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions