Skip to content

Commit 4d223b1

Browse files
ACPT-1742: Fixing: Redis Session uses 503.php which uses custom ObjectManager not compatible with ApplicationServer
The 503.php, and its friends, should not be used in ApplicationServer because Magento\Framework\Error\ProcessorFactory uses its own ObjectManager instead of the current one. Therefore, it is not compatible with ApplicationServer which relies own its own ObjectManager. This fix just changes The Redis session wrapper to throw an exception instead of calling 503.php. This change will change the behavior when ConcurrentConnectionsExceededException happens as it will now respond with 500 instead of 503.
1 parent 9846306 commit 4d223b1

File tree

1 file changed

+2
-1
lines changed
  • lib/internal/Magento/Framework/Session/SaveHandler

1 file changed

+2
-1
lines changed

lib/internal/Magento/Framework/Session/SaveHandler/Redis.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Cm\RedisSession\Handler\LoggerInterface;
1010
use Cm\RedisSession\ConnectionFailedException;
1111
use Cm\RedisSession\ConcurrentConnectionsExceededException;
12+
use Magento\Framework\Exception\LocalizedException;
1213
use Magento\Framework\Exception\SessionException;
1314
use Magento\Framework\Phrase;
1415
use Magento\Framework\Filesystem;
@@ -82,7 +83,7 @@ public function read($sessionId)
8283
try {
8384
$result = $this->getConnection()->read($sessionId);
8485
} catch (ConcurrentConnectionsExceededException $e) {
85-
require $this->filesystem->getDirectoryRead(DirectoryList::PUB)->getAbsolutePath('errors/503.php');
86+
throw new LocalizedException(__("Redis session exceeded concurrent connections"), $e);
8687
}
8788

8889
return $result;

0 commit comments

Comments
 (0)