From 6431a4e584d52170dbe873d93ba532659921740a Mon Sep 17 00:00:00 2001 From: Aditya Prajapati Date: Wed, 24 May 2023 17:46:28 +0530 Subject: [PATCH 1/2] multiline: remove incorrect flush we are flushing the stream buffer in case it is different in two consecutive runs, which leads to incorrect parsing of multiline logs where we have messages from different streams (stderr & stdout for ex) interleaved Signed-off-by: Aditya Prajapati --- src/multiline/flb_ml.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/multiline/flb_ml.c b/src/multiline/flb_ml.c index f3be4cdfe83..ae793b27759 100644 --- a/src/multiline/flb_ml.c +++ b/src/multiline/flb_ml.c @@ -232,7 +232,6 @@ static int package_content(struct flb_ml_stream *mst, } else { if (mst->last_stream_group != stream_group) { - flb_ml_flush_stream_group(parser, mst, mst->last_stream_group); mst->last_stream_group = stream_group; } } From 35f23875ca356ea30e9aac19854b810cf8ecad8f Mon Sep 17 00:00:00 2001 From: Aditya Prajapati Date: Thu, 25 May 2023 16:43:22 +0530 Subject: [PATCH 2/2] tests: ml: update expectation based on updated flush logic Signed-off-by: Aditya Prajapati --- tests/internal/multiline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/internal/multiline.c b/tests/internal/multiline.c index c909c1bbda1..6434931000d 100644 --- a/tests/internal/multiline.c +++ b/tests/internal/multiline.c @@ -110,8 +110,8 @@ struct record_check container_mix_input[] = { struct record_check container_mix_output[] = { {"a1\n"}, {"a2\n"}, - {"bbcc"}, {"ddee\n"}, + {"bbcc"}, {"single full"}, {"1a. some multiline log"}, {"1b. some multiline log"}, @@ -1345,7 +1345,7 @@ static void test_issue_5504() } TEST_CHECK(cb != NULL); - /* Trigger the callback without delay */ + /* Trigger the callback without delay */ cb(config, ml); /* This should not update the last_flush since it is before the timeout */ TEST_CHECK(ml->last_flush == last_flush);