]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Force GC after final batch to release all Redis connections 5737/head
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 8 Nov 2025 21:35:31 +0000 (21:35 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 8 Nov 2025 21:35:31 +0000 (21:35 +0000)
Previously GC was skipped for the final batch (batch_end >= #results),
leaving those connections checked out. The subsequent DEL of idx_key
could hit the pool limit if batch_size was near the limit, leaving the
_processing key behind and exhausting the pool for the next date.

Now collectgarbage() runs after every batch including the last one,
ensuring all connections are released before the DEL operation.

lualib/rspamadm/dmarc_report.lua

index da81a1483185da47dfac78a1ee7eddc1948d1850..ef4c20d451d33840fe82ae7d6ec7bf0d49d8c0dc 100644 (file)
@@ -624,10 +624,8 @@ local function process_report_date(opts, start_time, end_time, date)
       end
     end
 
-    -- Force garbage collection between batches to release Redis connections
-    if batch_end < #results then
-      collectgarbage("collect")
-    end
+    -- Force garbage collection after each batch to release Redis connections
+    collectgarbage("collect")
   end
 
   -- Shuffle reports to make sending more fair