[TikiWiki-commits] [Git][tikiwiki/tiki][24.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 <68fa12e7e6414_2c5fbe6467532@gitlab-sidekiq-low-urgency-cpu-bound-v2-69c854cfd9-n8g7d.mail>

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


Commits:
6c9699be by Victor Emanouilov at 2025-10-23T14:34:58+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
=====================================
@@ -13,6 +13,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)
     {
@@ -82,7 +83,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/6c9699be664359bc12735dfcdca28b017879ebab

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