Removing the temp directory after generating the plans will be better. Note that generating lots of plans without cleaning such a directory will take more inodes, which will impact the filesystem and would easily lead to consuming all inodes, preventing the system from creating new files.
The change is simple and can be done at this line:
tmpdir = tempfile.TemporaryDirectory()
# Do the planning stuff
# Invoke cleanup after solving the planning task.
tmpdir.cleanup()
Removing the
temp
directory after generating the plans will be better. Note that generating lots of plans without cleaning such a directory will take more inodes, which will impact the filesystem and would easily lead to consuming all inodes, preventing the system from creating new files.The change is simple and can be done at this line:
Thanks @speckdavid for highlighting this.