]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] elastic: use Queue:new() instead of non-existent lua_util.newdeque()
authorVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 4 May 2026 11:15:14 +0000 (12:15 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 4 May 2026 11:15:14 +0000 (12:15 +0100)
The 10x row-limit overflow guard called lua_util.newdeque(), which does
not exist, leaving buffer['logs'] as nil and causing subsequent operations
to fail. Reset the buffer using the local Queue class, matching how it is
initialized.

src/plugins/lua/elastic.lua

index 3683de68ba016927aed094e172e2f8542ed30207..f1de8e4b1f683384f550dbff9e65852cfa07235f 100644 (file)
@@ -681,7 +681,7 @@ local function elastic_collect(task)
   if nlogs >= settings['limits']['max_rows'] * 10 then
     rspamd_logger.errx(task, 'row count limit exceeded 10x: %s rows (limit %s), discarding data',
         nlogs, settings['limits']['max_rows'])
-    buffer['logs'] = lua_util.newdeque()
+    buffer['logs'] = Queue:new()
     collectgarbage()
     return
   end