From 3525cc6d1e59a34060d18365eb81fe8028e53237 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Wed, 3 Apr 2024 13:43:38 -0700 Subject: [PATCH] fix(messaging): fix worker crash when using custom SMTP provider Due to a bug in the Swoole TCP hook, the worker crashes when doing the TLS handshake. This PR disables the Swoole TCP hook just like we do in the mails worker. References: * https://github.com/appwrite/appwrite/issues/7914 * https://github.com/appwrite/appwrite/pull/6966 * https://github.com/swoole/swoole-src/issues/4909 --- src/Appwrite/Platform/Workers/Messaging.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Appwrite/Platform/Workers/Messaging.php b/src/Appwrite/Platform/Workers/Messaging.php index 85cc110d06..775ee23f32 100644 --- a/src/Appwrite/Platform/Workers/Messaging.php +++ b/src/Appwrite/Platform/Workers/Messaging.php @@ -4,6 +4,7 @@ namespace Appwrite\Platform\Workers; use Appwrite\Event\Usage; use Appwrite\Messaging\Status as MessageStatus; +use Swoole\Runtime; use Utopia\App; use Utopia\CLI\Console; use Utopia\Config\Config; @@ -80,6 +81,7 @@ class Messaging extends Action Device $deviceForLocalFiles, Usage $queueForUsage ): void { + Runtime::setHookFlags(SWOOLE_HOOK_ALL ^ SWOOLE_HOOK_TCP); $payload = $message->getPayload() ?? []; if (empty($payload)) {