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): hotswap should not disable rollback

See original GitHub issue

What is the problem?

Hi team! Currently when we enable hotswap, it also disables rollback implicitly, which is not desirable at least for me. Here is why:

  • Hotswap works without disabling rollback, e.g. by the command: cdk deploy --hotswap --rollback true. Then why does the hotswap flag currently have unnecessary and confusing side effect? If we need hotswap and no-rollback, we can just type cdk deploy --hotswap -R, which is shorter and more explicit.
  • Hotswap can be enabled at any time whereas rollback must not be disabled in some cases. If we disable rollback when there’s a replacement change, the deploy fails in the middle of deployment, requiring some manual operation to recover from the state. Due to this behavior, we need additional consideration when we disable rollback. That’s why I think rollback shouldn’t be disabled implicitly.

When I develop CDK apps, I always deploy with hotswap. Hotswap is great in that it automatically switch to a normal CFn deploy when there are changes that cannot be hotswapped, thus happy to use it almost brainlessly. However, I must also add --rollback true because otherwise deploy fails if there’s any replacement change. Unlike hotswap, it won’t switch when it cannot be used. It’d be great if we can just use --hotswap flag simply without worring about rollback. Actually I sometimes forget to add rollback flag, resulting in a failed deployment.

I’d like to hear your opinion about this, thanks!

Reproduction Steps

run deploy with hotswap enabled

npx cdk deploy --hotswap

What did you expect to happen?

Rollback is enabled as per default since I don’t specify any flags related to it.

What actually happened?

Rollback is disabled. Actually if we need hotswap with rollback, we should have used the command below instead:

npx cdk deploy --hotswap --rollback true

CDK CLI Version

1.129.0

Framework Version

1.129.0

Node.js Version

v14.15.0

OS

macOS

Language

Typescript

Language Version

3.9.7

Other information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
skinny85commented, Nov 3, 2021

@eladb agreed. I’ve opened a PR changing this behavior for --hotswap: https://github.com/aws/aws-cdk/pull/17317, would appreciate a review.

I’ll also make sure the “watch” PR (https://github.com/aws/aws-cdk/pull/17240) is updated to no longer default to rollback being disabled.

0reactions
github-actions[bot]commented, Nov 4, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Increasing development speed with CDK Watch - Amazon AWS
The --no-rollback flag will prevent CloudFormation from rolling back failed changes, saving more iteration time on failed deployments. To see ...
Read more >
CDK tips, part 6 – speeding up CDK application development
In part 6 of the 'CDK tips' series, we show how to accelerate deployments of code-only changes during development of CDK applications, ...
Read more >
Hot Swapping - Hetzner Docs
Generally, you should first remove the drive that you want replaced from the RAID. You should do this before you start the rest...
Read more >
Speeding up Lambda development with SAM & CDK
An extra option for CDK which doesn't have an equivalent in SAM is --no-rollback . It will prevent CloudFormation from rolling back failed ......
Read more >
HotSwap! - Mt.Naka
Although HotSwap! ensures that the volumes are not in use before attempting to remove the device, however, Windows will deny removing the device...
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