You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lambda layer invocations hang until timeout after return #24941
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.
Hono app exported via handle(app) from hono/aws-lambda, auto-wrapped by awsLambdaIntegration
Manual setup: NODE_OPTIONS="--import ./instrument.js" with a single Sentry.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/REPORT with Duration: 30000.00 ms, Status: timeout.
Not cold starts. Happens intermittently across many functions.
PostRuntimeExtensionsDuration spikes in the same time window: hourly Maximum of ~14.8s, plus a ~7.4s spike earlier the same day. Normal values are ~0.
Unknown
Whether the 14.8s PostRuntimeExtensionsDuration value 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/next loop has no error handling, and failures are only logged via debug, 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.
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.
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?
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?