mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-02-24 00:29:53 -05:00

The ``self._home_tmpdir.cleanup()`` cmd is not always executed when stopping Chrome. As a result, a large number of ``/tmp/tmpXXX`` dirs are created in production. The reason is that ``Chrome.stop()`` execution can stop in the ``return`` statement in the following line: https://github.com/internetarchive/brozzler/blob/master/brozzler/chrome.py#L268 and ``cleanup()`` does not run. Moving the ``cleanup()`` in the ``finally`` part of the ``try/catch/finally`` block makes it run always in the end of ``Chrome.stop()`` and cleans up the tmp directory in any case.