[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [FIX] Manticore - query retry when persistent connection is gone

"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]> Fri, 03 Jul 2026 11:57:25 +0000
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a47a3a5e8ed1_3819a5dc198d0@gitlab-sidekiq-low-urgency-cpu-bound-v2-69d694bf94-jbqwf.mail>

Victor Emanouilov pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki


Commits:
5fc3370d by Victor Emanouilov at 2026-07-03T14:57:21+03:00
[FIX] Manticore - query retry when persistent connection is gone

- - - - -


1 changed file:

- lib/core/Search/Manticore/PdoClient.php


Changes:

=====================================
lib/core/Search/Manticore/PdoClient.php
=====================================
@@ -599,10 +599,18 @@ class PdoClient
         }
     }
 
-    protected function query($sql)
+    protected function query($sql, $tries = 0)
     {
         $this->debug($sql);
-        return $this->pdo->query($sql);
+        try {
+            return $this->pdo->query($sql);
+        } catch (PDOException $e) {
+            if (strstr($e->getMessage(), "server has gone away") && $tries < self::QUERY_RETRIES) {
+                $this->connect(true);
+                return $this->query($sql, $tries + 1);
+            }
+            throw new Exception($e->getMessage());
+        }
     }
 
     protected function prepareAndExecute($sql, $params = [])



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/5fc3370dfbe74348e2e7ade643d6c15cffdc6f1c

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/5fc3370dfbe74348e2e7ade643d6c15cffdc6f1c
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs