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

Lambda with SnapStart enabled and Publish=True will block deployment of other lambda functions in the same program #3740

Closed
automagic opened this issue Mar 27, 2024 · 3 comments
Labels
impact/performance Something is slower than expected kind/bug Some behavior is incorrect or out of spec resolution/duplicate This issue is a duplicate of another issue

Comments

@automagic
Copy link

automagic commented Mar 27, 2024

What happened?

When updating multiple lambda function in the same program, enabling snapstart will cause each function to block until the previous publish is complete, which takes about 3min (sometimes longer) in AWS. In a stack with 20 lambdas, this can cause the deployment to take 1+ hrs.

Example

Example function config causing this issue:

lambda_handler = aws.lambda_.Function(
    f"{local_name}_handler",
    name=f"{local_name}_handler",
    role=iam_role_for_lambda.arn,
    package_type="Zip",
    runtime="java17",
    layers=["arn:aws:lambda:us-east-1:580247275435:layer:LambdaInsightsExtension:38"],
    code=FileArchive("..lambda.jar"),
    handler="handler",
    snap_start=aws.lambda_.FunctionSnapStartArgs(apply_on="PublishedVersions"),
    timeout=60,
    memory_size=768,
    vpc_config=aws.lambda_.FunctionVpcConfigArgs(
        subnet_ids=vpc.private_subnet_ids,
        security_group_ids=[security_group_for_lambdas.id]
    ),
    tracing_config=aws.lambda_.FunctionTracingConfigArgs(mode="PassThrough"),
    publish=True,
)

Output of pulumi about

3.111.0

Additional context

Example trace of multiple lambda blocking for 3min
image

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@automagic automagic added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Mar 27, 2024
@justinvp
Copy link
Member

This looks specific to AWS, so I'm going to transfer the issue to the AWS provider repo and someone will take a look.

@justinvp justinvp transferred this issue from pulumi/pulumi Mar 27, 2024
@corymhall corymhall added impact/performance Something is slower than expected and removed needs-triage Needs attention from the triage team labels Mar 27, 2024
@corymhall
Copy link
Contributor

@automagic it looks like this will take some time to investigate the root cause. Do you know what the urgency of this is? Do we need to find a solution this week or next?

@mikhailshilkov mikhailshilkov added the resolution/duplicate This issue is a duplicate of another issue label Mar 27, 2024
@mikhailshilkov
Copy link
Member

This is a duplicate of #2206

The sequential update behavior doesn't really depend on SnapStart or Publish=True but those properties magnify the issue due to each Code Update operation taking minutes instead of seconds.

I'll close this issue as a duplicate but will add a comment to the original one.

@mikhailshilkov mikhailshilkov closed this as not planned Won't fix, can't repro, duplicate, stale Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/performance Something is slower than expected kind/bug Some behavior is incorrect or out of spec resolution/duplicate This issue is a duplicate of another issue
Projects
None yet
Development

No branches or pull requests

4 participants