File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -964,7 +964,8 @@ int flb_engine_start(struct flb_config *config)
964
964
965
965
ret = sb_segregate_chunks (config );
966
966
967
- if (ret ) {
967
+ if (ret < 0 )
968
+ {
968
969
flb_error ("[engine] could not segregate backlog chunks" );
969
970
return -2 ;
970
971
}
@@ -1049,6 +1050,18 @@ int flb_engine_start(struct flb_config *config)
1049
1050
if (ret > 0 && (config -> grace_count < config -> grace || config -> grace == -1 )) {
1050
1051
if (config -> grace_count == 1 ) {
1051
1052
flb_task_running_print (config );
1053
+ /*
1054
+ * If storage.backlog.shutdown_flush is enabled, attempt to flush pending
1055
+ * filesystem chunks during shutdown. This is particularly useful in scenarios
1056
+ * where Fluent Bit cannot restart to ensure buffered data is not lost.
1057
+ */
1058
+ if (config -> storage_bl_shutdown_flush ) {
1059
+ ret = sb_segregate_chunks (config );
1060
+ if (ret < 0 ) {
1061
+ flb_error ("[engine] could not segregate backlog chunks during shutdown" );
1062
+ return -2 ;
1063
+ }
1064
+ }
1052
1065
}
1053
1066
if ((mem_chunks + fs_chunks ) > 0 ) {
1054
1067
flb_info ("[engine] pending chunk count: memory=%d, filesystem=%d; grace_timer=%d" ,
You can’t perform that action at this time.
0 commit comments