plotman icon indicating copy to clipboard operation
plotman copied to clipboard

plotman kill doesn't remove all temp files

Open Carglglz opened this issue 3 years ago • 3 comments

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.

Carglglz avatar May 19 '21 17:05 Carglglz

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.

SandboChang avatar Jun 04 '21 14:06 SandboChang

@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

mk01 avatar Jun 30 '21 01:06 mk01

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

altendky avatar Jun 30 '21 01:06 altendky