#42963 closed enhancement (fixed)
Improve deletion of $_old_files during upgrades
Reported by: | joemcgill | Owned by: | dd32 |
---|---|---|---|
Milestone: | 4.9.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Upgrade/Install | Keywords: | has-patch |
Focuses: | Cc: |
Description
While testing upgrades for #42720, it occurred to me that if the upgrade process failed to delete old files, we were potentially leaving rather large files behind to clutter up the file system. To avoid this scenario, we could attempt to empty the contents of old files if they still exist after unsuccessfully deleting them during an upgrade routine.
Attachments (1)
Change History (18)
#2
@
7 years ago
is_file( $old_file )
won't work as expected here, as $to
is not always a full filesystem path.
Personally I think we can skip the is_file()
check, as delete()
should return correctly.
In the worst case scenario, where delete()
returns incorrectly, it'll get removed on the next run hopefully.
This seems like a good addition overall. I think we should also consider back-porting the change to all autoupdate branches so that all updates are consistent.
#3
@
7 years ago
- Owner set to dd32
- Resolution set to fixed
- Status changed from new to closed
In 42433:
#5
@
7 years ago
- Milestone changed from 5.0 to 4.9.2
This seems like a good addition overall. I think we should also consider back-porting the change to all autoupdate branches so that all updates are consistent.
Going to do exactly this. In most cases this shouldn't ever actually be needed, but as we ship this file with all autoupdates we might as well have it be consistent between every version.
42963.diff writes an empty string to files that still exist after an unsuccessful deletion attempt.