Skip to content

Commit 193394f

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

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
@@ -964,7 +964,8 @@ int flb_engine_start(struct flb_config *config)
964964

965965
ret = sb_segregate_chunks(config);
966966

967-
if (ret) {
967+
if (ret < 0)
968+
{
968969
flb_error("[engine] could not segregate backlog chunks");
969970
return -2;
970971
}
@@ -1049,6 +1050,11 @@ int flb_engine_start(struct flb_config *config)
10491050
if (ret > 0 && (config->grace_count < config->grace || config->grace == -1)) {
10501051
if (config->grace_count == 1) {
10511052
flb_task_running_print(config);
1053+
ret = sb_segregate_chunks(config);
1054+
if (ret < 0) {
1055+
flb_error("[engine] could not segregate backlog chunks");
1056+
return -2;
1057+
}
10521058
}
10531059
if ((mem_chunks + fs_chunks) > 0) {
10541060
flb_info("[engine] pending chunk count: memory=%d, filesystem=%d; grace_timer=%d",

0 commit comments

Comments
 (0)