-
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
(core): proliferation of cdk.out$hash directories in $TMPDIR #27356
Comments
I suspect that it's expected that |
@indrora On a CI/CD system, that makes sense... but on a local development environment I think it's more of a problem. It also likely slows down the build process quite a bit as well - rebuilding assets that don't need to be rebuilt. Thoughts? |
I have seen files & directories accumulate in my temp folder as well when running I narrowed it down to two file name patterns and one directory name pattern, I look for all of them and remove the directories where they live. The following shows the temp dirs/files left behind in a "clean" temp dir after running
|
If you work with AWS CDK locally you soon have 1000's of abandoned folders in e.g.
|
n.b. I no longer work for Amazon, the following is purely my own opinion as a member of the community. The CDK is generally designed to be used on Linux; the vast majority of Linux distributions mount macOS is an inscrutable black box in this regard in that it relies on launchd and cron to clean up unloved files that have not been touched or opened in >3 days depending on the version of macOS that you are running. That said: it is generally considered (In My Experience) good practice as you have noted to include some prefix or to consume some sub-path of I believe a possible workaround (though I have not tested this) is to use the TMPDIR environment variable. I will defer to current maintainers on that specific issue however. |
Whether |
N.B. I no longer work for Amazon as previously stated and this is my opinion as a community member. The standard says "/tmp is a wasteland trash dump, don't expect what you put there to be there next time you come back" in slightly more formal words. No guidance is given on hygiene, but the charitable read is "Some programs will leave garbage there, and how that garbage is dealt with is up to the system administrator." On the other side, some people feel that it should be cleaned up, such as systemd-nspawn. My comment here? If it bugs you so much, pull requests are appreciated. Feel free to submit a PR that adds the desired cleanup, ostensibly behind a flag or other toggle. |
Describe the bug
On my laptop, I've noticed recently that my
$TMPDIR
is filling up... this feels like a new behavior, as we've been developing with CDK for almost a year now, and only recently did this start happening to me. It's tough to pinpoint when, but I think it has to do with thecdk.out
directory being renamed tocdk.out$hash
at some point. In the last 2 days, I've accumulated over 170GB of temp data:$ sudo du -sch $TMPDIR 170G /var/folders/dm/b5by_qw91nd0ctdjbvggzgr40000gq/T/ 170G total
When I dig into it, it's all CDK data:
I have over 9000+ individual test directories:
This feels similar to #2869 - but not exactly the same..
Expected Behavior
I expect that the TMPDIR data would be cleaned up after each run... but I think that this was never needed back when the output dir was
$TMPDIR/cdk.out
.. but now it's$TMPDIR/cdk.out$rand
and that is causing this buildup of junk.Current Behavior
Build up of left over junk tmp data dirs..
Reproduction Steps
Just run your tests over and over again
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.93.0
Framework Version
No response
Node.js Version
18
OS
OSX
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: