Repository navigation
Description
A customer using the Sentry Node Lambda layer sees warm invocations on many functions randomly run until the function timeout, even though the handler has already finished. The only extension attached is the one shipped in the Sentry layer, and CloudWatch shows elevated PostRuntimeExtensionsDuration, so this looks like a possible Sentry Lambda extension hang. This doesn't match the >300s trigger in #24218 (fixed in #24811), since these functions have a 30s timeout.
Environment
@sentry/aws-serverless10.59.0, layerSentryNodeServerlessSDKv10:73nodejs18.x, CJS output via esbuild (SST v2), 30s timeout, 1024 MB- Hono app exported via
handle(app)fromhono/aws-lambda, auto-wrapped byawsLambdaIntegration - Manual setup:
NODE_OPTIONS="--import ./instrument.js"with a singleSentry.init(tracing on,captureConsoleIntegration,ignoreSpans) - No other Lambda extensions
Observed (verified from customer logs/metrics)
- Handler logs its final line about 140 ms into the invocation. Nothing is logged after that until
END/REPORTwithDuration: 30000.00 ms,Status: timeout. - Not cold starts. Happens intermittently across many functions.
PostRuntimeExtensionsDurationspikes in the same time window: hourlyMaximumof ~14.8s, plus a ~7.4s spike earlier the same day. Normal values are ~0.
Unknown
- Whether the 14.8s
PostRuntimeExtensionsDurationvalue comes from the timed-out invocation. The metric is aggregated, so it can't be tied to a request ID. - Why the 14.8s maximum doesn't account for the full ~29.9s gap after the handler finished.
- What the extension is doing during the delay. In
packages/aws-serverless/src/lambda-extension/the/event/nextloop has no error handling, and failures are only logged viadebug, which never prints in the extension process. So a stalled or dead poll would leave no trace.
Hypothesis (medium confidence): the layer extension sometimes delays or stops calling /event/next after an invocation, and Lambda holds the invocation open until the timeout. The trigger is unknown, but it isn't the 300s undici headersTimeout described in #24218.
via Daniel Sheccoury.
--
Metadata
Metadata
Assignees
Projects
- StatusShow more project fieldsWaiting for: Product Owner
Activity
linear-code commentedon Oct 1, 2026
JS-3862
danielsheccoury-sentry commentedon Oct 1, 2026
The customer reported the behavior here.
msonnb commentedon Oct 2, 2026
Hey! If a connection failure causes the extension to stop polling and then timeout, this should still be caught and fixed by #24828. If there's another fatal error happening, this will also help with investigating since it logs them directly with
console.error. We'll probably do a release on Monday to get this out.msonnb commentedon Oct 2, 2026
Actually, it's been released right now as
SentryNodeServerlessSDKv10:95(SDK version 10.76.0)! Could you ask them to try again with that version and see if the issue still persists?