Skip to content

[core] regression - the new LambdaClock and Instant breaks HTTP headers sent by LocalServer #551

@sebsto

Description

@sebsto

The change recently introduced by #540 (remove dependency on DispatchWallTime) introduced a regression.

The Lambda runtime client crashes because of "missing required headers" (AWSLambdaRuntime.LambdaRuntimeError.Code.nextInvocationMissingHeaderDeadline) when calling the Lambda Local Server for testing.

When the runtime client calls HTTP GET /next, it checks for presence of mandatory server headers. One of them is Lambda-Runtime-Deadline-Ms which is expected to be an EPOCH number (see https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html#runtimes-api-next)

The newly introduced LambdaClock.Instant doesn't generate the correct value, probably a lack of CustomStringConvertible. The object is rendered as string instead of the EPOCH value.

Lambda-Runtime-Aws-Request-Id: 21235745116708; Lambda-Runtime-Invoked-Function-Arn: arn:aws:lambda:us-east-1:-6648:function:custom-runtime; Lambda-Runtime-Trace-Id: Root=1-68aaeb5d-86cd1c934bb9178e8c7e6ec0;Sampled=1; Lambda-Runtime-Deadline-Ms: Instant(instant: 1756032737492); Content-Length: 26

Instant is not rendered correctly.

Instant(instant: 1756032737492)

instead of

1756032737492

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions