Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/@aws-cdk/toolkit-lib/lib/api/refactoring/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { ResourceLocation, ResourceMapping } from './cloudformation';
import { hashObject } from './digest';
import type { MappingGroup } from '../../actions';
import { ToolkitError } from '../../toolkit/toolkit-error';
import { pLimit } from '../../util/concurrency';

export * from './exclude';
export * from './context';
Expand Down Expand Up @@ -144,8 +145,10 @@ export async function getDeployedStacks(
};
};

const limit = pLimit(20);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still seems like a high number?

Are the retry settings configured thoroughly enough for the CFN client?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the current retry strategy for the CFN client:

new ConfiguredRetryStrategy(11, (attempt: number) => 1000 * (2 ** attempt))

I ran an experiment with this strategy, against an account with 342 templates. I didn't start getting throttling errors until concurrency = 47. So, 20 might be playing it too safely, actually.

Just as a sanity check, without any retry strategy, even with concurrency = 2, I would sometimes get a throttling error.

Copy link
Contributor

@rix0rrr rix0rrr Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM, thanks!


// eslint-disable-next-line @cdklabs/promiseall-no-unbounded-parallelism
return Promise.all(summaries.map(normalize));
return Promise.all(summaries.map(s => limit(() => normalize(s))));
}

export function formatEnvironmentSectionHeader(environment: cxapi.Environment) {
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ command to consider only a subset of them, you can specify the stacks you
want, both local and deployed:

```shell
$ cdk refactor --local-stack Foo --local-stack Bar --deployed-stack Foo --unstable=refactor --dry-run
$ cdk refactor Test* ProdStack --unstable=refactor --dry-run
```

This is useful if, for example, you have more than one CDK application deployed
Expand Down
Loading