[wp-trac] [WordPress Trac] #54589: Audit and preload current "from" version files into memory before upgrading filesystem to the "to" version

WordPress Trac noreply at wordpress.org
Mon Dec 6 14:31:04 UTC 2021

#54589: Audit and preload current "from" version files into memory before upgrading
filesystem to the "to" version
 Reporter:  hellofromTonya   |      Owner:  (none)
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  6.0
Component:  Upgrade/Install  |    Version:
 Severity:  normal           |   Keywords:  early
  Focuses:                   |
 Follow-up to #54546.

 Some terms for clarity:
 * current "from" version: the current version of WordPress on the site
 * new "to" version: the version of WordPress that the site will be
 upgraded to after the upgrade process is complete

 == The Problem

 In the `wp-admin/includes/update-core.php` file, the filesystem is
 upgraded to the new "to" version before all of the upgrader process is

 What happens if the rest of the upgrader process doesn't yet have its code
 loaded into memory?

 * Fatal error, for example #54546
 * Unexpected behavior due to intermingling of "from" and "to" version of

 A fatal error happened in #54546 when cURL timed out and attempted to
 throw an exception when its file hadn't yet been loaded into memory. The
 exception class was changed, which would be handled by the "to" version
 autoloader but was not recognized by the "from" version autoloader in

 While #54546 is a specific instance, it revealed a fundamental problem in
 Core's upgrader.

 == The Goal

 Ensure all files from the current ("from") version of WordPress that may
 be needed during the upgrade process are loaded into memory ''before''
 upgrading the filesystem and database to the "to" version of WordPress.

 == Audit and Preload current "from" version files into memory

 An audit will be needed to identify all of the files that are or could be
 used during the upgrade process, including alternative paths such as
 errors which may have dependencies.

 A preloader mechanism will be needed capable of loading nested directories
 (such as loading an entire library or API into memory such as Requests)
 and individual files.

 Consideration will be needed for:
 * differences in current "from" versions of files and code
 * possibly for downgrades from "to" version back to the "from" version
 * case-insensitive filesystems as identified in #54582

 Props to @jrf, @pbiron, @costdev, @schlessera, @sergeybiryukov, and @mkaz
 for extensive investigation and testing.

Ticket URL: <https://core.trac.wordpress.org/ticket/54589>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list