coin-or / pulp

A python Linear Programming API
http://coin-or.github.io/pulp/
Other
2.04k stars 381 forks source link

intermediary files not removed from /tmp by default #657

Closed beevabeeva closed 1 year ago

beevabeeva commented 1 year ago

Details for the issue

What did you do?

Our server ran out of space this morning. Turns out there were 150 GB worth of lp files in /tmp ([uuid]-pulp.lp).

What did you expect to see?

I thought that these lp files were removed automatically. The reason I thought this was because I read the docs when I began using PuLP!! : image

What did you see instead?

It seems either the docs are lying (:stuck_out_tongue_winking_eye:) or there is a bug causing the code to not have the default behaviour described in the docs.

I just checked if the environment variables listed in that snippet from the docs were set, but they are not: image

But how is CPLEX able to read the lp file? i.e it must get the path somehow, without needing those environment variables to be set. I am missing something here...

Note Admittedly, I am using PuLP version 2.4 and reading the docs of version 2.7 :sweat_smile: I think there may be a reason I'm not using 2.7 but can't remember (could be related to a bug with Gurobi in another project).

workaround

When I added keepFiles=False into my script, it stopped storing the lp files in /tmp after the run had completed.

Useful extra information

What operating system are you using?

I'm using python version:

I installed PuLP via:

Did you also

beevabeeva commented 1 year ago

Hi, I am closing this for now as I believe it's possible that those 150GB of files were from runs that did not complete (i.e were interrupted manually or due to error), in which case it is impossible for PuLP to cleanup the temp files.

I would maybe add something to the documentation, warning users that interrupted runs will lead to temp files remaining in the temp directory. It might not be a problem for most people since /tmp gets cleaned out on boot. But for company servers that hardly get rebooted, this is what can happen.

Will re-open if it turns out that removing keepFiles=False results in the the temp files being stored even for completed runs.

Thanks