[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [FIX] Elasticsearch bulk operation flush - observe content length besides item...

"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68fa12c8c4c2a_2ca8a81819620@gitlab-sidekiq-low-urgency-cpu-bound-v2-69c854cfd9-tdcw8.mail>

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


Commits:
acaf6cd8 by Victor Emanouilov at 2025-10-23T14:34:23+03:00
[FIX] Elasticsearch bulk operation flush - observe content length besides item count, so we avoid bypassing server limits and dropping full bulk chunks

- - - - -


1 changed file:

- lib/core/Search/Elastic/BulkOperation.php


Changes:

=====================================
lib/core/Search/Elastic/BulkOperation.php
=====================================
@@ -11,6 +11,7 @@ class Search_Elastic_BulkOperation
     private $callback;
     private $mapping_type;
     private $buffer = '';
+    private $max_buffer_size = 20 * 1024 * 1024; // 20MB, ES defaults http.max_content_length to 100MB but it is safer to flush more frequently
 
     public function __construct($limit, $callback, $mapping_type)
     {
@@ -80,7 +81,7 @@ class Search_Elastic_BulkOperation
             }
         }
 
-        if ($this->count >= $this->limit) {
+        if ($this->count >= $this->limit || strlen($this->buffer) >= $this->max_buffer_size) {
             $this->flush();
         }
     }



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

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/acaf6cd8f1a4f0f3efec9fc546b786b1d6393fa9
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.