-
Notifications
You must be signed in to change notification settings - Fork 4.3k
refactor(cli): make corked logging part of CliIoHost #33226
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This review is outdated)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #33226 +/- ##
=======================================
Coverage 80.78% 80.79%
=======================================
Files 232 232
Lines 14111 14106 -5
Branches 2453 2452 -1
=======================================
- Hits 11400 11397 -3
+ Misses 2431 2429 -2
Partials 280 280
Flags with carried forward coverage won't be shown. Click here to find out more.
|
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
➡️ PR build request submitted to A maintainer must now check the pipeline and add the |
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly, corked logging is mostly for instances when we are prompting the user and we don't want to pollute the stream with additional input until we collect our response. That will become something that anyone with two CliIoHost writing to the same stream has to manage on their own (since the CliIoHost cork independently of each other). But since the CLI only ever uses 1 CliIoHost, it won't be a problem for the aws-cdk CLI
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
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
notifyto not be awaitable in same cases. The previous logging implementation 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
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license