From 23b7001a44c46da4ef80b8f6996d228f4ea2826d Mon Sep 17 00:00:00 2001 From: blued_gear Date: Fri, 17 Jul 2026 17:45:24 +0200 Subject: [PATCH 1/4] call gc_collect_cycles() for every message --- src/MessageHandler/MbinMessageHandler.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/MessageHandler/MbinMessageHandler.php b/src/MessageHandler/MbinMessageHandler.php index 9b9346b7e7..509c0d3dcb 100644 --- a/src/MessageHandler/MbinMessageHandler.php +++ b/src/MessageHandler/MbinMessageHandler.php @@ -23,6 +23,8 @@ public function __construct( */ public function workWrapper(MessageInterface $message): void { + gc_collect_cycles(); + // when we are in the test environment this would throw: ConnectionException: There is no active transaction. if ('test' !== $this->kernel->getEnvironment()) { $conn = $this->entityManager->getConnection(); From 93cf34d7fbd39301b3fc2b3e587837527b33e493 Mon Sep 17 00:00:00 2001 From: blued_gear Date: Sun, 19 Jul 2026 10:29:43 +0000 Subject: [PATCH 2/4] do gc_collect_cycles() at the end --- src/MessageHandler/MbinMessageHandler.php | 26 ++++++++++++----------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/MessageHandler/MbinMessageHandler.php b/src/MessageHandler/MbinMessageHandler.php index 509c0d3dcb..091ba88348 100644 --- a/src/MessageHandler/MbinMessageHandler.php +++ b/src/MessageHandler/MbinMessageHandler.php @@ -23,18 +23,20 @@ public function __construct( */ public function workWrapper(MessageInterface $message): void { - gc_collect_cycles(); - - // when we are in the test environment this would throw: ConnectionException: There is no active transaction. - if ('test' !== $this->kernel->getEnvironment()) { - $conn = $this->entityManager->getConnection(); - $conn->getNativeConnection(); // calls connect() internally - - $conn->transactional(fn () => $this->doWork($message)); - - $conn->close(); - } else { - $this->doWork($message); + try { + // when we are in the test environment this would throw: ConnectionException: There is no active transaction. + if ('test' !== $this->kernel->getEnvironment()) { + $conn = $this->entityManager->getConnection(); + $conn->getNativeConnection(); // calls connect() internally + + $conn->transactional(fn() => $this->doWork($message)); + + $conn->close(); + } else { + $this->doWork($message); + } + } finally { + gc_collect_cycles(); } } From 73fbccbdfa08ab8129e97c11bdde2aa20fe5c669 Mon Sep 17 00:00:00 2001 From: blued_gear Date: Sun, 19 Jul 2026 10:33:46 +0000 Subject: [PATCH 3/4] linter --- src/MessageHandler/MbinMessageHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MessageHandler/MbinMessageHandler.php b/src/MessageHandler/MbinMessageHandler.php index 091ba88348..e4259a77b7 100644 --- a/src/MessageHandler/MbinMessageHandler.php +++ b/src/MessageHandler/MbinMessageHandler.php @@ -29,7 +29,7 @@ public function workWrapper(MessageInterface $message): void $conn = $this->entityManager->getConnection(); $conn->getNativeConnection(); // calls connect() internally - $conn->transactional(fn() => $this->doWork($message)); + $conn->transactional(fn () => $this->doWork($message)); $conn->close(); } else { From 2d44c827dad92933bf5584d6b923b97af1486b5b Mon Sep 17 00:00:00 2001 From: blued_gear Date: Sun, 19 Jul 2026 10:34:11 +0000 Subject: [PATCH 4/4] add more excluded directories for linter (to keep it from failing locally) --- .php-cs-fixer.dist.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 28c6ce86ec..7cddee2db5 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -9,6 +9,8 @@ 'node_modules', 'vendor', 'docker', + 'public', + 'storage', ]) ;