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

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


Commits:
74d9f659 by Victor Emanouilov at 2025-10-23T14:34:44+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/74d9f659df666e473121e4b44ce83f686e6289b3

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