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

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

Victor Emanouilov pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
a641f733 by Victor Emanouilov at 2026-07-03T14:56:52+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/a641f733c06508e06b739b92b7f48746af9f2139

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/a641f733c06508e06b739b92b7f48746af9f2139
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