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

(CLI): hotswap still does not wait for Lambda code to be fully updated #22666

Closed
MikeFHay opened this issue Oct 27, 2022 · 3 comments
Closed
Assignees
Labels
bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. needs-triage This issue or PR still needs to be triaged. package/tools Related to AWS CDK Tools or CLI response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@MikeFHay
Copy link

MikeFHay commented Oct 27, 2022

Describe the bug

I own a Lambda within a VPC. When I run cdk deploy --hotswap --method=direct --require-approval=never $stackName, and run tests against the deployed Lambda, I see that the previous version of the lambda code is run. Waiting a minute and running the test again correctly runs against the updated code. This issue was supposedly fixed in #18386 , but I am still seeing the issue in CDK 2.45.0. According to that issue the delay is particularly large for Lambdas within VPCs, so this may not be noticeable on other Lambdas.

Expected Behavior

After cdk deploy --hotswap exits, all future calls to the deployed Lambda should see the new code.

Current Behavior

After cdk deploy --hotswap exits, immediately calling the deployed Lambda executes the previous code.

Reproduction Steps

Make an observable change to a Lambda within a VPC, run cdk deploy --hotswap --method=direct --require-approval=never $stackName, immediately call the lambda, and observe that the code change is not in effect. Wait and call again to confirm that the code change is eventually present.

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.45.0

Framework Version

No response

Node.js Version

14.20.1

OS

Amazon Linux

Language

Typescript

Language Version

No response

Other information

No response

@MikeFHay MikeFHay added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 27, 2022
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Oct 27, 2022
@MikeFHay
Copy link
Author

Actually seems like this happens without --hotswap too.

@rix0rrr
Copy link
Contributor

rix0rrr commented Nov 8, 2022

Without --hotswap, this would do a full CloudFormation deployment. Are you observing the same behavior there?

If you can reproduce this, can you do a describe of the lambda immediately after updating it and show the status? If the status is success and yet the code is not updated, there's unfortunately nothing we can do here and this would be an issue for the Lambda team.

@rix0rrr rix0rrr added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Nov 8, 2022
@github-actions
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. needs-triage This issue or PR still needs to be triaged. package/tools Related to AWS CDK Tools or CLI response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants