From 3b0e51e9c362e76256f5309115dcaa5324d22623 Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Tue, 3 Oct 2023 14:00:14 +0900 Subject: [PATCH] plugin_proxy: Prevent to execute flush callback on Golang side during hot-reloading Signed-off-by: Hiroshi Hatake --- src/flb_plugin_proxy.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/flb_plugin_proxy.c b/src/flb_plugin_proxy.c index eed253aa011..a23634c59d3 100644 --- a/src/flb_plugin_proxy.c +++ b/src/flb_plugin_proxy.c @@ -50,6 +50,14 @@ static void proxy_cb_flush(struct flb_event_chunk *event_chunk, (void) i_ins; (void) config; + /* To prevent flush callbacl executions, we need to check the + * status of hot-reloading. The actual problem is: we don't have + * pause procedure for output plugin. For now, we just halt the + * flush callback here. */ + if (config->shutdown_by_hot_reloading == FLB_TRUE) { + flb_trace("[GO] hot-reloading is in progress. Retry flushing"); + FLB_OUTPUT_RETURN(FLB_RETRY); + } #ifdef FLB_HAVE_PROXY_GO if (ctx->proxy->def->proxy == FLB_PROXY_GOLANG) {