-
Notifications
You must be signed in to change notification settings - Fork 4k
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
DeGlobalize log corking #32898
Labels
@aws-cdk/core
Related to core CDK functionality
effort/medium
Medium work item – several days of effort
p2
Comments
1 task
1 task
mergify bot
pushed a commit
that referenced
this issue
Jan 29, 2025
### Issue Closes #32898 ### Reason for this change Today the log corking mechanism maintains both a global cork counter as well as a global log buffer. This is a problem for the Programmatic Toolkit as globally maintained memory can potentially lead to unexpected behavior especially in multithreaded workloads. ### Description of changes Moves all corked logging features inside the `CliIoHost`. Different instances will use independent corking, but that's okay since the CLI only ever uses a single instance. Adjusts tests accordingly. Also reverts a change to promisify writing to the output stream. This was introduced in #32503 but causes `notify` to not be awaitable in same cases. The [previous logging implementation](https://github.com/aws/aws-cdk/blob/9604c62ebc9759e07abda426ec3bb644d8e58807/packages/aws-cdk/lib/logging.ts#L55) never had that behavior and this is actually unnecessary. https://github.com/aws/aws-cdk/pull/32503/files#diff-bc64c3cc9fa21a1c5af3389d57fd0aa0428343f2b0ea095748d9a457279797e6R85-R93 ### Describe any new or updated permissions being added n/a ### Description of how you validated changes ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Comments on closed issues and PRs are hard for our team to see. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
@aws-cdk/core
Related to core CDK functionality
effort/medium
Medium work item – several days of effort
p2
Depends on #32816
Today the log corking mechanism maintains both a global cork counter as well as a global log buffer. This is a problem for the Programmatic Toolkit as globally maintained memory can potentially lead to unexpected behavior especially in multithreaded workloads.
log corking logic needs to be moved into the IoHost class and specific to that IoHost instance
The text was updated successfully, but these errors were encountered: