ericaltendorf / plotman

Chia plotting manager
Apache License 2.0
909 stars 280 forks source link

plotman kill doesn't remove all temp files #582

Open Carglglz opened 3 years ago

Carglglz commented 3 years ago

Describe the bug

plotman kill doesn't remove all the temp files in tmp directory To Reproduce

Steps to reproduce the behavior, e.g.:

  1. plotman kill [idprefix] and select remove all temp files.
  2. go to tmp directory
  3. ls -l | grep [idprefix] shows there are still some files

This leads to a tmp dir full of old tmp files from dead plots which fills the tmp dir unnecessarily.

Expected behavior

Remove all temp files.

This is probably because

temp_files = job.get_temp_files()

does not return all temp files, so it may be better to add os.listdir(tmp_dir) and some pattern matching to be sure it's all gone.

SandboChang commented 3 years ago

Have the same issue here, and I am worried this contributes to my case when I sometimes see plots getting slower/frozen while the number of plots are within the drives' volume; it looks like there are some zombie files which plotman did not remove have occupied some space, and that affected new plot tasks.

mk01 commented 3 years ago

@SandboChang @Carglglz

this comes from the fact that the official chia plotter is closing various files during various stages and reopening when needed - and plotman removing files as per the open files list at the moment of terminating the job.

so yes, cleanup based on open files should be replaced by cleanup based on regex listing over used dirs of the particular job

altendky commented 3 years ago

That change has been merged to the development branch. It might get released this week.