Skip to content

Commit fb13aeb

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

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/flb_engine.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,8 @@ int flb_engine_start(struct flb_config *config)
950950

951951
ret = sb_segregate_chunks(config);
952952

953-
if (ret) {
953+
if (ret < 0)
954+
{
954955
flb_error("[engine] could not segregate backlog chunks");
955956
return -2;
956957
}
@@ -1035,6 +1036,11 @@ int flb_engine_start(struct flb_config *config)
10351036
if (ret > 0 && (config->grace_count < config->grace || config->grace == -1)) {
10361037
if (config->grace_count == 1) {
10371038
flb_task_running_print(config);
1039+
ret = sb_segregate_chunks(config);
1040+
if (ret < 0) {
1041+
flb_error("[engine] could not segregate backlog chunks");
1042+
return -2;
1043+
}
10381044
}
10391045
if ((mem_chunks + fs_chunks) > 0) {
10401046
flb_info("[engine] pending chunk count: memory=%d, filesystem=%d; grace_timer=%d",

0 commit comments

Comments
 (0)