From 38f5650e624a4ab3c9a67df6ffdab43cc792b0b1 Mon Sep 17 00:00:00 2001 From: amdoolittle Date: Mon, 30 Oct 2023 21:40:42 -0700 Subject: [PATCH] Buffer: Fix NoMethodError with empty unstaged chunk arrays (#4303) Signed-off-by: Alex Doolittle --- lib/fluent/plugin/buffer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fluent/plugin/buffer.rb b/lib/fluent/plugin/buffer.rb index d04ae08296..3871b4f25b 100644 --- a/lib/fluent/plugin/buffer.rb +++ b/lib/fluent/plugin/buffer.rb @@ -417,7 +417,7 @@ def write(metadata_and_data, format: nil, size: nil, enqueue: false) if c.staged? && (enqueue || chunk_size_full?(c)) m = c.metadata enqueue_chunk(m) - if unstaged_chunks[m] + if unstaged_chunks[m] && !unstaged_chunks[m].empty? u = unstaged_chunks[m].pop u.synchronize do if u.unstaged? && !chunk_size_full?(u)