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]>
  • Loading branch information
nokute78 committed Jun 17, 2022
1 parent d2167ed commit a5bfb28
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 a5bfb28

Please sign in to comment.