Open Bug 948641 Opened 8 years ago Updated 8 years ago

Temporary profiles should be named more descriptively (and possibly deleted on abnormal shutdown)


(Testing :: General, defect)

Not set


(Not tracked)


(Reporter: cjones, Unassigned)


My use case is running gecko test harnesses, let's say the mochitest harness for concreteness, many many times to debug a problem with an external tool.  The details of the tool aren't important, but the important part is that the problem manifests as a "hang" of the mochitest harness.  I then have to interrupt the harness with SIGINT (Ctrl-c).  When this happens, apparently the temporary profile is left behind.  There are two potential problems with this

 1. The profile is named "/tmp/tmpXXXXXX".  That's not a good name, because to delete all the old profiles, I have to run |rm -rf /tmp/tmp*|.  I expect there are other programs that create temporary files that match the pattern "/tmp/tmp*", so I never know what I'm deleting.

 2. The old profiles accumulate (obviously).  I'm notified that I need to clean up the profiles when my /tmp filesystem fill up.  That will interfere with my host system.

I certainly think (1) should be fixed, with a more descriptive name like "/tmp/gecko-mochitest-profileXXXXX" used.  That seems like it should be relatively easy too.

I would like for (2) to be changed so that the profile is always deleted.  To do so, the profile creation code would need to install the equivalent of a bash EXIT trap handler (I don't know the python-ese translation off hand) that deleted the profile.  I could certainly understand an argument to the contrary, that abnormal shutdown should leave behind the profile for later debugging, so maybe automatic always-deletion could be a command-line option.

Apologies if I filed this in the wrong place.
I'm pretty sure we used to remove the profile in a finally block, maybe that behavior got lost in the great refactoring. Naming the profiles usefully would be nice, but if we fix the cleanup bit it's not really necessary.
You need to log in before you can comment on or make changes to this bug.