Closed bqpd closed 4 years ago
I still see temporary files lingering. I saw a number of temporary directories created and deleted, but not all got deleted. The directories that remain have gpkit_mosek and gpkit_mosek.sol files in them.
Maybe you need some while loop to check if the file still lingers.
huh, they should all be getting deleted: either by os.remove or by shutil.rmtree! Even weirder that some are and some are not deleted.
One (kinda silly) alternative could be to reuse the same temporary filename for each session of gpkit, which should work but also creates an entirely unnecessary potential race condition.
On Thu, Oct 17, 2019 at 12:55 PM Marshall Galbraith < notifications@github.com> wrote:
I still see temporary files lingering. I saw a number of temporary directories created and deleted, but not all got deleted. The directories that remain have gpkit_mosek and gpkit_mosek.sol files in them.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/convexengineering/gpkit/pull/1445?email_source=notifications&email_token=AALKAGCEYBJSEB3U6MC4NO3QPCKGHA5CNFSM4JB3IYJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBQZNXQ#issuecomment-543266526, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALKAGGKEKVBGJ5LJ5OC64TQPCKGHANCNFSM4JB3IYJQ .
There is a while loop in the rmtree function! If all remaining directories also have files leftover, that implies os.remove isn't doing anything, so this PR isn' necessary.
On Thu, Oct 17, 2019 at 12:59 PM Marshall Galbraith < notifications@github.com> wrote:
Maybe you need some while loop to check if the file still lingers.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/convexengineering/gpkit/pull/1445?email_source=notifications&email_token=AALKAGEXQUKZD6SCDBGEX43QPCKTBA5CNFSM4JB3IYJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBQZYIQ#issuecomment-543267874, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALKAGHNPASWT4POAA2NBS3QPCKTBANCNFSM4JB3IYJQ .
Welcome to the world of windoze. I'm guessing Windoze is locking the file claiming it is still in use when you are trying to remove it. Humor me and put a while exists in front of each remove command.
done! added while loop
test this please
You missed the '.path.'. Should be:
os.path.isfile(filename)
derp
On Thu, Oct 17, 2019 at 3:42 PM Marshall Galbraith notifications@github.com wrote:
You missed the '.path.'. Should be:
os.path.isfile(filename)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/convexengineering/gpkit/pull/1445?email_source=notifications&email_token=AALKAGHKVF6MAYD5NBFVXRLQPC5XLA5CNFSM4JB3IYJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBRJCWI#issuecomment-543330649, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALKAGCAQFU232JBUFFWW4LQPC5XLANCNFSM4JB3IYJQ .
Nope... try this:
try:
shutil.rmtree(path)
except OSError as e:
# Reraise unless ENOENT: No such file or directory
# (ok if directory has already been deleted)
if e.errno != errno.ENOENT:
raise
Heh, wrapped it around my existing recursion; how's that?
Geez! I don't know why some still linger... For all these incarnations there are fewer left behind, there are still ~5-10 that don't get deleted.
Oh wait. Wrong PR building.
Try removing the extra arguments to shutil.rmtree.
done! :| thanks so much for like...watching the temporary files directory
On Thu, Oct 17, 2019 at 4:33 PM Marshall Galbraith notifications@github.com wrote:
Try removing the extra arguments to shutil.rmtree.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/convexengineering/gpkit/pull/1445?email_source=notifications&email_token=AALKAGFLIPFFFMXZXGWTEJ3QPDD2VA5CNFSM4JB3IYJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBRN3SQ#issuecomment-543350218, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALKAGENEKXWTDMAA5XC2D3QPDD2VANCNFSM4JB3IYJQ .
I don't understand this... There are still files lingering, but it is better than what it was without any of these changes. Maybe the while should be on the directory instead of the file inside?
heh. giving that a try...
On Thu, Oct 17, 2019 at 5:33 PM Marshall Galbraith notifications@github.com wrote:
I don't understand this... There are still files lingering, but it is better than what it was without any of these changes. Maybe the while should be on the directory instead of the file inside?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/convexengineering/gpkit/pull/1445?email_source=notifications&email_token=AALKAGHKKRHQAKCJRHTA36DQPDKXNA5CNFSM4JB3IYJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBRS4MQ#issuecomment-543370802, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALKAGCN7U5RYGHYVFMYEBTQPDKXNANCNFSM4JB3IYJQ .
test this please