question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(CLI): hotswapping should wait for Lambda's `updateFunctionCode` operation to complete

See original GitHub issue

Description

Right now, when hotswapping Lambda code, we don’t wait for the updateFunctionCode API call we make to complete.

However, according to the documentation, this operation is actually eventually consistent today for Lambda functions that use Docker images, or are present in a VPC, and, even more importantly, this API will become eventually consistent for all Functions starting February 1, 2022.

We need to change our logic to wait for the operation to complete.

While implementing this, we should be cognizant of making sure we wait as effectively as possible, to not affect Lambda hotswap times too adversely. The simplest solution might be to use the standard Lambda waiter, that we use if we need to publish a new Version. Perhaps we can use a custom Waiter for this purpose, like we do for ECS service hotswapping.

Thanks a lot to @tmokmss who figured out all of this while working on Docker image Function hotswapping.

Acknowledge

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
corymhallcommented, Jan 18, 2022

@skinny85 my comment describes the state with those changes in place. In the current state the State will always be active and the LastUpdateStatus will always be Successful.

1reaction
corymhallcommented, Jan 14, 2022

@skinny85 yep I’ve already started working on it 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

function-updated — AWS CLI 1.27.37 Command Reference
Waits for the function's LastUpdateStatus to be Successful. This waiter uses GetFunctionConfiguration API. This should be used after function updates.
Read more >
How can I let aws cli command wait until the update finish?
It will wait until the Lambda's LastUpdateStatus will be successful, meaning that the next update can be invoked.
Read more >
Hot Swapping - LocalStack Docs
Hot code swapping for Lambda functions using LocalStack's code mounting. ... In our implementation, we will be watching for fs changes under the...
Read more >
Improving CDK development cycle - Instil Software
Spend less time waiting on deployments with CDK hot swaps ... only changed the code of a Lambda function, and nothing else in...
Read more >
Lambda — Boto3 Docs 1.26.35 documentation - Amazon AWS
When accessing the Lambda management console or Lambda API endpoints, whether through browsers or programmatically, you will need to ensure your client machines ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found