Skip to content
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

Fix extension compatibility issues with AWS Lambda Runtime Interface Emulator #879

Merged
merged 2 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lambda-extension/src/events.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use serde::Deserialize;

/// Request tracing information
#[derive(Debug, Deserialize)]
#[derive(Debug, Default, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Tracing {
/// The type of tracing exposed to the extension
Expand All @@ -20,6 +20,7 @@ pub struct InvokeEvent {
/// The function's Amazon Resource Name
pub invoked_function_arn: String,
/// The request tracing information
#[serde(default)]
pub tracing: Tracing,
rebu-dt marked this conversation as resolved.
Show resolved Hide resolved
}

Expand Down
6 changes: 3 additions & 3 deletions lambda-extension/src/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ where
self.log_port_number,
)?;
let res = client.call(req).await?;
if res.status() != http::StatusCode::OK {
if !res.status().is_success() {
let err = format!("unable to initialize the logs api: {}", res.status());
return Err(ExtensionError::boxed(err));
}
Expand Down Expand Up @@ -318,7 +318,7 @@ where
self.telemetry_port_number,
)?;
let res = client.call(req).await?;
if res.status() != http::StatusCode::OK {
if !res.status().is_success() {
let err = format!("unable to initialize the telemetry api: {}", res.status());
return Err(ExtensionError::boxed(err));
}
Expand Down Expand Up @@ -491,7 +491,7 @@ async fn register<'a>(

let req = requests::register_request(&name, events)?;
let res = client.call(req).await?;
if res.status() != http::StatusCode::OK {
if !res.status().is_success() {
let err = format!("unable to register the extension: {}", res.status());
return Err(ExtensionError::boxed(err));
}
Expand Down
Loading