Closed (won't fix)
Project:
Drush
Version:
8.x-6.x-dev
Component:
Core Commands
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 May 2012 at 21:33 UTC
Updated:
11 Sep 2013 at 05:12 UTC
Drush doesn't cleanup temporary files created with drush_save_data_to_temp_file() anymore. For a reason that is unclear to me, the drush_register_file_dor_delettion function isn't called anymore in Drush 5.x.
Even in Drush 4, where the function is called properly, if the script is interrupted halfway, the tempfile is not deleted.
I noticed this while working on #671906: mysql credentials leak in drush sqlc.
Comments
Comment #1
greg.1.anderson commentedReally? I added a drush_log to _drush_delete_registered_files(), and observed that it was getting called, and the temp files for sql-sync were being deleted. Perhaps there are specific conditions when the shutdown function is not being called?
Comment #2
anarcat commentedRight, I was confused by the fact that the register moved to *tempnam()...
Regardless, the "register_shutdown" functions never get called if PHP gets interrupted (control-c), so yes, this still stands. At the very least I could reproduce this with Drush 4 and the patch in #671906: mysql credentials leak in drush sqlc, by running drush sqlc and interrupting it after the patch is applied.
Comment #3
greg.1.anderson commentedYea, I wasn't checking the interrupted case. We could take care of that with a call to pcntl-signal.
Comment #4
jonhattanRelated #590634: interruptions should launch rollbacks
Comment #5
greg.1.anderson commentedThis issue was marked
closed (won't fix)because Drush has moved to Github.If desired, you may copy this bug to our Github project and then post a link here to the new issue. Please also change the status of this issue to
closed (duplicate).Please ask support questions on Drupal Answers.
Comment #5.0
greg.1.anderson commentedadd source