Skip to content

Commit

Permalink
ml: clear last recently used parser to match next parser(fluent#5524)
Browse files Browse the repository at this point in the history
Signed-off-by: Takahiro Yamashita <[email protected]>
Signed-off-by: Manal Geries <[email protected]>
  • Loading branch information
nokute78 authored and mgeriesa committed Oct 25, 2022
1 parent c1f286b commit 46f6c2d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/multiline/flb_ml.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,9 +709,11 @@ int flb_ml_append(struct flb_ml *ml, uint64_t stream_id,
}
}
else if (lru_parser && lru_parser->last_stream_id > 0) {
flb_ml_flush_parser_instance(ml,
lru_parser,
lru_parser->last_stream_id);
/*
* Clear last recently used parser to match new parser.
* Do not flush last_stream_id since it should continue to parsing.
*/
lru_parser = NULL;
}
}

Expand Down Expand Up @@ -819,9 +821,11 @@ int flb_ml_append_object(struct flb_ml *ml, uint64_t stream_id,
}
}
else if (lru_parser && lru_parser->last_stream_id > 0) {
flb_ml_flush_parser_instance(ml,
lru_parser,
lru_parser->last_stream_id);
/*
* Clear last recently used parser to match new parser.
* Do not flush last_stream_id since it should continue to parsing.
*/
lru_parser = NULL;
}
}

Expand Down

0 comments on commit 46f6c2d

Please sign in to comment.