-
Notifications
You must be signed in to change notification settings - Fork 518
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
Disk space not freed after syft command #416
Comments
Hi @rmkanda! Thanks for reporting this. Our expectation is that all files we create are cleaned up after the run completes. (The exceptions to this are in cases where the app crashes or when the app is terminated early.) So this is definitely a problem, and we need to look more into it.
We use your OS's tmp directory (seen by running I think I'm able to reproduce what you're describing... How to reproduceI have a split screen terminal. On the left, I’m running I’m finding that this count returns to the starting point only sometimes. I'll be looking more into what might be causing this. |
Hi @luhring, I have a few question about these temp files: For context, I intend to use Syft for large-volume scans of about There are two things I would like to ask regarding this:
Thank you! |
@DatGameh first of all, I should note that Syft should be cleaning this stuff up and if it's not, that's a bug we need to fix (I thought it had been, when this was closed). To answer your specific questions:
However, in figuring this out, I was able to reproduce some leftovers that should be cleaned up but are not. For example:
Although in this case, the directory has some subdirectories but ultimately they are all empty, so I'm not sure steps offhand to reproduce large content being left on the filesystem. Regardless, these temp directories should get cleaned up, so I'm reopening this issue for that purpose. EDIT: after debugging and re-running, I am seeing these temp directories getting properly cleaned up most of the time (really, all of the time now, aside from the first example where it did not properly clean up). |
@kzantow Thank you for looking into the issue for me! Here are extra details which hopefully helps: The OS I am using is either RHEL 8.9 or Ubuntu 22.04 The task I am doing requires me to scan hundreds of images in a short period. I used this as reference to implement limited concurrency: https://death.andgravity.com/limit-concurrency#asyncio-semaphore Perhaps, could it be running multiple scans simultaneously that's causing this issue? Here's an example of my script, using Python3.11:
Please let me know if you need any additional info. Thanks! |
@DatGameh sorry for the delay getting back to you. I've spent quite a bit of time trying to reproduce this but I'm just really not able to. I'm not sure if I possibly killed a process and left some files not cleaned up when I saw this originally, but I can't come up with a way to reproduce it -- even using concurrent scans with a modified version of your provided script. The only thing I can think that's causing this for you is something is killing the process before it terminates normally (including things like out of memory), but without being able to make some sort of steps to reproduce the issue, it's nearly impossible to debug and fix. Is there anything else you could provide to help with reproduction -- maybe a script including a bunch of specific images that exhibits the problem? |
Thank you for looking into the problem! There are times when I need to abruptly end the program, since the scanning process naturally takes a long time to complete. In my attempts to recreating the problem so far, prematurely ending my program (e.g. SIGINT) does reproduce the undeleted temp files rather consistently. I didn't think to mention it initially, because I thought temp files should naturally be deleted even if the process terminates prematurely. I apologize for not mentioning it earlier. I wonder then: Is it expected that ending the process prematurely means the temp files do not get deleted? So far, I have not been able to reproduce the problem if I allow the program to finish naturally, but I will continue trying to recreate it and report to you if I am able to reproduce it. |
Thanks @DatGameh. Given there really hasn't been a way to reproduce this that anyone has found (other than killing the process, which is expected to not execute clean up code), I'm going to close this again. Sorry for the noise here! If we do find a way to reproduce this, let's open a new issue with the exact steps/scripts/etc. that can be used. Thanks in advance! |
What happened:
Whenever I ran syft command to analyse a image the disk usage goes up and once the syft is completed.
The utilized disk space is not freed.
What is the temporary directory? Can the disk space freed automatically?
Environment:
syft version
: 0.15.2The text was updated successfully, but these errors were encountered: