When killing a job, plotman does not delete temp files
Killed server jobs with the command ./plotman.py kill xxxx, plotman correctly identifies the job and plot and asks if I want to kill it. When I said yes, it errors out saying that it cannot find the log file. The plot process is killed but I have to manually go in and delete all the temp files from the temp directory.
Sorry to double back on this. I thought this was fixed with someone else's commit. Are you still seeing this issue with the latest from the development branch?
**Update, this comment was written while I had error-prone memory and I was only killing halted processes that crashed due to the memory issue. It might not be the case if the process is behaving properly.
I'm seeing this issue with development branch currently. Right now the process is used to get the temp files.
def get_temp_files(self):
# Prevent duplicate file paths by using set.
temp_files = set([])
for f in self.proc.open_files():
if self.tmpdir in f.path or self.tmp2dir in f.path or self.dstdir in f.path:
temp_files.add(f.path)
return temp_files
Doing a plot name match would pick up all the files. E.g.
def get_temp_files(self):
# Prevent duplicate file paths by using set.
temp_files = set([])
for f in self.proc.open_files():
if self.tmpdir in f.path or self.tmp2dir in f.path or self.dstdir in f.path:
temp_files.add(f.path)
with os.scandir(self.tmpdir) as it:
for entry in it:
if self.plot_id in entry.name:
try:
temp_files.add(entry.path)
except FileNotFoundError:
# The file might disappear
pass
if self.tmp2dir:
with os.scandir(self.tmp2dir) as it:
for entry in it:
if self.plot_id in entry.name:
try:
temp_files.add(entry.path)
except FileNotFoundError:
# The file might disappear
pass
return temp_files
Is this still a problem? Not sure if this relates: https://github.com/ericaltendorf/plotman/issues/181
I still have this problem.
It never deletes temp files.