From 5134cb8a9d8fd99835ac8b06178912e900e1f42b Mon Sep 17 00:00:00 2001 From: Luke Rodgers Date: Tue, 3 Jun 2025 08:51:32 +0200 Subject: [PATCH 1/3] Fix concurrency issue in static content deploy --- app/code/Magento/Deploy/Process/Queue.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/Deploy/Process/Queue.php b/app/code/Magento/Deploy/Process/Queue.php index 35d85c390b9c4..07b72343ee6bb 100644 --- a/app/code/Magento/Deploy/Process/Queue.php +++ b/app/code/Magento/Deploy/Process/Queue.php @@ -263,6 +263,10 @@ private function executePackage(Package $package, string $name, array &$packages && !$this->isDeployed($package) && ($this->maxProcesses < 2 || (count($this->inProgress) < $this->maxProcesses)) ) { + if (!isset($packages[$name])) { + $this->logger->debug('Preventing duplicate execution of package as it is in progress: ' . $package->getPath() . ' (pid: ' . $this->getPid($package) . ')'); + return; + } unset($packages[$name]); $this->execute($package); } From 6e0e8af981b819e69d491db138c89e1c72caccb0 Mon Sep 17 00:00:00 2001 From: Luke Rodgers Date: Tue, 3 Jun 2025 12:07:24 +0200 Subject: [PATCH 2/3] Update Queue.php - Fix code style --- app/code/Magento/Deploy/Process/Queue.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Deploy/Process/Queue.php b/app/code/Magento/Deploy/Process/Queue.php index 07b72343ee6bb..3c4708c34c6eb 100644 --- a/app/code/Magento/Deploy/Process/Queue.php +++ b/app/code/Magento/Deploy/Process/Queue.php @@ -264,7 +264,11 @@ private function executePackage(Package $package, string $name, array &$packages && ($this->maxProcesses < 2 || (count($this->inProgress) < $this->maxProcesses)) ) { if (!isset($packages[$name])) { - $this->logger->debug('Preventing duplicate execution of package as it is in progress: ' . $package->getPath() . ' (pid: ' . $this->getPid($package) . ')'); + $this->logger->debug(sprintf( + 'Preventing duplicate execution of package as it is in progress: %s (pid: %s)', + $package->getPath(), + $this->getPid($package) + )); return; } unset($packages[$name]); From 563dc1bbb28d0b7abc09e3460989f92caedce9d1 Mon Sep 17 00:00:00 2001 From: engcom-Dash Date: Fri, 6 Jun 2025 11:25:13 +0530 Subject: [PATCH 3/3] Fixed Static Failures & Review Comment --- app/code/Magento/Deploy/Process/Queue.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Deploy/Process/Queue.php b/app/code/Magento/Deploy/Process/Queue.php index 3c4708c34c6eb..e7429af416a51 100644 --- a/app/code/Magento/Deploy/Process/Queue.php +++ b/app/code/Magento/Deploy/Process/Queue.php @@ -1,7 +1,7 @@ isDeployed($package) && ($this->maxProcesses < 2 || (count($this->inProgress) < $this->maxProcesses)) ) { + //Prevents duplicate execution of a theme package by checking if it has already been scheduled. if (!isset($packages[$name])) { $this->logger->debug(sprintf( 'Preventing duplicate execution of package as it is in progress: %s (pid: %s)',