WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 15 months ago

#42196 new defect (bug)

WP_Upgrader->unpack_package can't run in parallel

Reported by: sheldonh Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Upgrade/Install Keywords:
Focuses: Cc:

Description

Although WP_Upgrader->unpack_package takes care to assign a unique $working_dir for the package being unpacked, it recursively deletes the contents of $upgrade_folder before it does its work.

Since $upgrade_folder is the parent of $working_dir, concurrent unpack_package calls interfere with each other. In particular, this defeats parallel wp theme install; one install is likely to encounter ENOENT while trying to copy it unpacked files out of $working_dir.

Attachments (1)

class-wp-upgrader.patch (1.1 KB) - added by sheldonh 4 years ago.
Demonstration of possible solution

Download all attachments as: .zip

Change History (4)

@sheldonh
4 years ago

Demonstration of possible solution

#1 @sheldonh
4 years ago

I know next to nothing about WordPress or PHP, but I've uploaded a patch that at least demonstrates a possible solution. With the patch applied, I can run multiple wp theme install commands in parallel.

This ticket was mentioned in Slack in #core by markparnell. View the logs.


15 months ago

#3 @markparnell
15 months ago

  • Component changed from General to Upgrade/Install

Hi @sheldonh, thanks for the report and sorry it's taken so long for anyone to respond! I don't know enough about the WP_Upgrader class to be of much help here, but I'm moving this to the Upgrade/Install component where it will be more likely to attract the attention of those who do.

Note: See TracTickets for help on using tickets.