From db7cf76e265daae24b44f98d1f4ff6b0549a5b6f Mon Sep 17 00:00:00 2001 From: Wesley Pettit Date: Sun, 16 Jun 2024 19:03:31 -0700 Subject: [PATCH] engine: send backlog chunks on shutdown Signed-off-by: Wesley Pettit --- src/flb_engine.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/flb_engine.c b/src/flb_engine.c index 15a27bcc069..ec27e5637a1 100644 --- a/src/flb_engine.c +++ b/src/flb_engine.c @@ -771,7 +771,7 @@ int flb_engine_start(struct flb_config *config) ret = sb_segregate_chunks(config); - if (ret) + if (ret < 0) { flb_error("[engine] could not segregate backlog chunks"); return -2; @@ -839,6 +839,11 @@ int flb_engine_start(struct flb_config *config) if (ret > 0 && config->grace_count < config->grace) { if (config->grace_count == 1) { flb_task_running_print(config); + ret = sb_segregate_chunks(config); + if (ret < 0) { + flb_error("[engine] could not segregate backlog chunks"); + return -2; + } } if ((mem_chunks + fs_chunks) > 0) { flb_info("[engine] Pending chunk count: memory=%d, filesystem=%d; grace_timer=%d",