-
Notifications
You must be signed in to change notification settings - Fork 503
Lambda-Runtime-Invocation-Id #2508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
GarrettBeatty
wants to merge
9
commits into
dev
Choose a base branch
from
feature/crosswire-invocation-id
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0334c94
Read Lambda-Runtime-Invocation-Id header from /next
GarrettBeatty 67bd78b
Echo invocation id and handle invoke-timeout (410) in the API client
GarrettBeatty 619851f
Log and continue on invoke-timeout (410) instead of crashing
GarrettBeatty addbda6
Echo invocation id on the streaming response path
GarrettBeatty f8d7ffb
Add change file for cross-wiring invocation-id support
GarrettBeatty 2e31307
Add missing invocationId XML param doc on ErrorWithXRayCauseAsync
GarrettBeatty 8ed9c6a
Remove redundant comments in RawStreamingHttpClient
GarrettBeatty c26abf0
Remove redundant ExceptionInfo computation in ReportInvocationErrorAsync
GarrettBeatty 6ca75e3
Update Annotations diagnostic line pins for InternalClientAdapted.cs …
GarrettBeatty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
.autover/changes/4133a18f-b6f9-4f24-886e-217756fbb670.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "Projects": [ | ||
| { | ||
| "Name": "Amazon.Lambda.RuntimeSupport", | ||
| "Type": "Minor", | ||
| "ChangelogMessages": [ | ||
| "Add support for the Lambda-Runtime-Invocation-Id header for cross-wiring invoke protection. The runtime echoes the header back on the response and error calls when the Runtime API provides it, and treats an HTTP 410 Gone (invoke timeout) response as a non-fatal condition, logging it and continuing to the next invocation." | ||
| ] | ||
| } | ||
| ] | ||
| } |
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,7 +65,19 @@ public interface IRuntimeApiClient | |
| /// <param name="cancellationToken">The optional cancellation token to use.</param> | ||
| /// <returns>A Task representing the asynchronous operation.</returns> | ||
| Task ReportInvocationErrorAsync(string awsRequestId, Exception exception, CancellationToken cancellationToken = default); | ||
|
|
||
|
|
||
| /// <summary> | ||
| /// Report an invocation error as an asynchronous operation, echoing the invocation id for | ||
| /// cross-wiring protection. | ||
| /// </summary> | ||
| /// <param name="awsRequestId">The ID of the function request that caused the error.</param> | ||
| /// <param name="invocationId">The unique-per-invocation id to echo back to the Runtime API. When null, the header is not sent.</param> | ||
| /// <param name="exception">The exception to report.</param> | ||
| /// <param name="cancellationToken">The optional cancellation token to use.</param> | ||
| /// <returns>A Task representing the asynchronous operation.</returns> | ||
| /// <exception cref="RuntimeApiInvokeTimeoutException">The invocation timed out before the error was submitted (cross-wiring protection).</exception> | ||
| Task ReportInvocationErrorAsync(string awsRequestId, string invocationId, Exception exception, CancellationToken cancellationToken = default); | ||
|
|
||
|
Comment on lines
+69
to
+80
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this interface should really have been internal. not worried about this as per norm |
||
| /// <summary> | ||
| /// Triggers the snapshot to be taken, and then after resume, restores the lambda | ||
| /// context from the Runtime API as an asynchronous operation when SnapStart is enabled. | ||
|
|
@@ -91,5 +103,17 @@ public interface IRuntimeApiClient | |
| /// <param name="cancellationToken">The optional cancellation token to use.</param> | ||
| /// <returns></returns> | ||
| Task SendResponseAsync(string awsRequestId, Stream outputStream, CancellationToken cancellationToken = default); | ||
|
|
||
| /// <summary> | ||
| /// Send a response to a function invocation to the Runtime API as an asynchronous operation, | ||
| /// echoing the invocation id for cross-wiring protection. | ||
| /// </summary> | ||
| /// <param name="awsRequestId">The ID of the function request being responded to.</param> | ||
| /// <param name="invocationId">The unique-per-invocation id to echo back to the Runtime API. When null, the header is not sent.</param> | ||
| /// <param name="outputStream">The content of the response to the function invocation.</param> | ||
| /// <param name="cancellationToken">The optional cancellation token to use.</param> | ||
| /// <returns></returns> | ||
| /// <exception cref="RuntimeApiInvokeTimeoutException">The invocation timed out before the response was submitted (cross-wiring protection).</exception> | ||
| Task SendResponseAsync(string awsRequestId, string invocationId, Stream outputStream, CancellationToken cancellationToken = default); | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should never happen