Skip to content

Commit 76c983b

Browse files
PettitWesleysingholt
authored andcommitted
engine: send backlog chunks on shutdown
Signed-off-by: Wesley Pettit <[email protected]>
1 parent c2b3d47 commit 76c983b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/flb_engine.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,8 @@ int flb_engine_start(struct flb_config *config)
946946

947947
ret = sb_segregate_chunks(config);
948948

949-
if (ret) {
949+
if (ret < 0)
950+
{
950951
flb_error("[engine] could not segregate backlog chunks");
951952
return -2;
952953
}
@@ -1023,6 +1024,11 @@ int flb_engine_start(struct flb_config *config)
10231024
if (ret > 0 && (config->grace_count < config->grace || config->grace == -1)) {
10241025
if (config->grace_count == 1) {
10251026
flb_task_running_print(config);
1027+
ret = sb_segregate_chunks(config);
1028+
if (ret < 0) {
1029+
flb_error("[engine] could not segregate backlog chunks");
1030+
return -2;
1031+
}
10261032
}
10271033
flb_engine_exit(config);
10281034
}

0 commit comments

Comments
 (0)