Files
triggerdotdev--trigger.dev/.changeset/api-client-request-timeout.md
Eric Allam 3b7e47e775
📦 Preview packages (pkg.pr.new) / Build and publish previews (push) Has been cancelled
fix(core): time out API requests so a dead socket can't hang a call
API client requests had no timeout, so a request reusing a half-open keep-alive connection could hang until the runtime's socket default (minutes) rather than failing fast, and the retry logic never engaged because a hang produces no response to react to. Requests now run under a default 30s timeout (configurable per request via timeoutInMs); on timeout the request is aborted and the retry reconnects on a fresh socket. Caller cancellations are not retried.
2026-06-30 09:19:07 +01:00

773 B

@trigger.dev/core
@trigger.dev/core
patch

API requests now run under a request timeout (default 30s), so a half-open keep-alive connection can no longer hang a call until the runtime's socket default (minutes). On timeout the request aborts and retries on a fresh connection, and the retry is duplicate-safe via the request idempotency key. This mostly affects long-lived processes that reuse connections, including tasks that trigger other tasks.

Set the timeout per request, per client, or globally (most specific wins, 0 disables):

tasks.trigger("my-task", payload, undefined, { timeoutInMs: 10_000 }); // per request
new TriggerClient({ accessToken, requestOptions: { timeoutInMs: 10_000 } }); // per client
// or globally: TRIGGER_API_REQUEST_TIMEOUT_MS=10000