feat: add lambda-runtime-invocation-id header - #1159
Merged
darklight3it merged 13 commits intoSep 2, 2026
Conversation
darklight3it
force-pushed
the
feat/add-runtime-invocation-id-header-support
branch
from
August 9, 2026 18:16
b60f865 to
048c1e8
Compare
darklight3it
force-pushed
the
feat/add-runtime-invocation-id-header-support
branch
from
August 26, 2026 16:15
4c28d43 to
afb6708
Compare
darklight3it
marked this pull request as ready for review
August 26, 2026 16:18
darklight3it
force-pushed
the
feat/add-runtime-invocation-id-header-support
branch
from
August 26, 2026 16:23
afb6708 to
de1f2e4
Compare
darklight3it
force-pushed
the
feat/add-runtime-invocation-id-header-support
branch
5 times, most recently
from
August 27, 2026 12:49
c403f80 to
31c22d2
Compare
darklight3it
force-pushed
the
feat/add-runtime-invocation-id-header-support
branch
from
August 27, 2026 13:11
31c22d2 to
2cabdac
Compare
vip-amzn
reviewed
Aug 27, 2026
vip-amzn
reviewed
Aug 27, 2026
vip-amzn
reviewed
Aug 27, 2026
darklight3it
force-pushed
the
feat/add-runtime-invocation-id-header-support
branch
from
August 27, 2026 16:04
fc33a71 to
1152b7c
Compare
vip-amzn
approved these changes
Aug 27, 2026
jlizen
requested changes
Aug 28, 2026
jlizen
left a comment
Member
There was a problem hiding this comment.
Core approach is good, but some small tweaks.
Also: currently we log Lambda function timeout! for any 410, but we now will have a 410 if a stale response is rejected. We should tweak the message.
darklight3it
force-pushed
the
feat/add-runtime-invocation-id-header-support
branch
2 times, most recently
from
August 31, 2026 08:01
58592a7 to
bc1209f
Compare
darklight3it
force-pushed
the
feat/add-runtime-invocation-id-header-support
branch
from
August 31, 2026 08:06
bc1209f to
c09906e
Compare
darklight3it
force-pushed
the
feat/add-runtime-invocation-id-header-support
branch
from
August 31, 2026 10:52
c09906e to
eddf4c5
Compare
jlizen
reviewed
Sep 1, 2026
jlizen
reviewed
Sep 1, 2026
jlizen
approved these changes
Sep 1, 2026
darklight3it
deleted the
feat/add-runtime-invocation-id-header-support
branch
September 2, 2026 08:59
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
Lambda-Runtime-Invocation-Idheader support for cross-wiring protection.The RIC now echoes the invocation ID received from RAPID on
/nextback on/responseand/error, enabling RAPID to detect and reject stale responses from timed-out invocations.Problem
On Lambda Managed Instances (LMI) and On-Demand (OD), when an invoke times out, the runtime process continues running in the background. If a new invoke arrives with the same
requestId, RAPID accepts it. The still-running old invocation eventually posts its response, and RAPID matches it to the new invoke — delivering the wrong response (cross-wiring).Solution
RAPID sends a unique per-invoke nonce via
Lambda-Runtime-Invocation-Idheader on/next. The runtime echoes it back on/responseand/error. RAPID validates the match before accepting the response.Backward Compatibility
Fully backward compatible in both directions:
Rate-limited malformed-header logging
Added an internal generic
RateLimiterfor runtime different uses. In this case the request was to rate limit warning caused by malformedLambda-Runtime-Invocation-Idheaders.The limiter:
Instantand configurableDuration.tracing, allowing a futuretracing-subscriberintegration without coupling the runtime behavior to a specific subscriber.Malformed invocation-ID headers are ignored rather than converted with
from_utf8_lossy, because the value may be echoed back as an HTTP header and must remain a valid ASCII header value. A rate-limited warning is emitted with the configured interval included as structured log metadata.Testing