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): describeStackEvents queries ALL stack events when looking for new events #32186

Closed
1 task done
frederik-alpha opened this issue Nov 19, 2024 · 3 comments · Fixed by #32196
Closed
1 task done
Labels
bug This issue is a bug. effort/medium Medium work item – several days of effort p0 package/tools Related to AWS CDK Tools or CLI potential-regression Marking this issue as a potential regression to be checked by team member

Comments

@frederik-alpha
Copy link

Describe the bug

After upgrading to 2.167.0, our deployments using GitHub Actions went from taking 10-11 minutes, to taking ~1 hour.

In reality, the deployments are taking roughly the same time, but the GitHub Actions runner is not receiving the answer.

I believe this is due to a change where all the stack events are loaded at once, before looping through them from newest to oldest and stopping when an event is met that has already been handled.

It should be said that I queried all stack events for one of our stacks and it has ~400,000 events.

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

2.166.0

Expected Behavior

CLI getting feedback about stack deployment quickly.

Current Behavior

CLI not getting feedback about stack deployment until a long time after stack deployment has actually finished.

Reproduction Steps

The error only occurs when you have a stack with a large amount of stack events. I do not know how to reproduce that in a test.
The issue occurs for us when using cdk deploywith a stack that has ~400,000 stack events.

Possible Solution

const eventList = await this.cfn.describeStackEvents({

This method is calling describeStackEvents, and iterating through them, stopping when it reaches one that has already been handled, or one that is older than the poller itself.

describeStackEvents: async (input: DescribeStackEventsCommandInput): Promise<StackEvent[]> => {

The method describeStackEvents is iterating through all pages of the stack events, before returning all of them.

My suggestion is that the poller itself should be iterating through the pages of the stack events, similar to how it was in 2.166.0. Alternatively, the describeStackEvents should return an async iterable or something similar, but my TypeScript is not strong enough to know if that is possible :-)

Additional Information/Context

No response

CDK CLI Version

2.167.1 (build d681b12)

Framework Version

No response

Node.js Version

v22.9.0

OS

macOS 14.6

Language

Python

Language Version

Python 3.10

Other information

No response

@frederik-alpha frederik-alpha added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 19, 2024
@github-actions github-actions bot added aws-cdk-lib Related to the aws-cdk-lib package potential-regression Marking this issue as a potential regression to be checked by team member labels Nov 19, 2024
@pahud pahud self-assigned this Nov 19, 2024
@pahud
Copy link
Contributor

pahud commented Nov 19, 2024

Thank you for your report. We'll report it to the core team for further investigations.

@iliapolo iliapolo changed the title (aws-cdk-lib) (CLI): describeStackEvents queries ALL stack events when looking for new events (cli): describeStackEvents queries ALL stack events when looking for new events Nov 19, 2024
@iliapolo iliapolo added package/tools Related to AWS CDK Tools or CLI and removed aws-cdk-lib Related to the aws-cdk-lib package labels Nov 19, 2024
@pahud pahud added p2 and removed needs-triage This issue or PR still needs to be triaged. labels Nov 19, 2024
@pahud pahud removed their assignment Nov 19, 2024
@pahud pahud added the effort/medium Medium work item – several days of effort label Nov 19, 2024
@iliapolo iliapolo added the p0 label Nov 19, 2024
@pahud pahud removed the p2 label Nov 19, 2024
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

1 similar comment
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. effort/medium Medium work item – several days of effort p0 package/tools Related to AWS CDK Tools or CLI potential-regression Marking this issue as a potential regression to be checked by team member
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants