Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
engine: enforce and reduce shutdown time
In the current implementation when a shutdown has been requested through a SIGTERM (or catched by ctrl-c), Fluent Bit initialized the shutdown process and gives a grace period to wait for the active tasks to finish. The problem with the approach is that grace period was not being respected, actually the grace period was being renewed always waiting to flush all the pending tasks. This patch changes the behavior of the grace period where now the grace period is considered (as it should) the 'maximum time to wait' for pending tasks. If the tasks did not finished flushing under the flush period the service will stop right away. In addition, when no tasks exists, the patch makes the service stop before the grace period time, since there is no need to continue waiting. Common tests: 1. Exit before grace period: fluent-bit -i cpu -o stdout -f 1 hit ctrl-c, the service will stop before grace period (at second 1 or 2). 2. Force active Tasks by using an uresponsive remote network address: fluent-bit -i cpu -o stdout -m '*' -o http://192.168.3.4:3833 -m '*' -f 1 on SIGTERM, the tasks will still be active because the unresponsive network, by forcing a shutdown the grace period will be respected and the service stop at the right moment. Signed-off-by: Eduardo Silva <[email protected]>
- Loading branch information