From df35c841b7cc47bc79c3e4cf024639c6ebbcba36 Mon Sep 17 00:00:00 2001 From: Wesley Pettit Date: Tue, 11 Apr 2023 15:17:49 -0700 Subject: [PATCH] upstream: always remove keepalive close event on shutdown if registered Resolves this issue: https://github.com/fluent/fluent-bit/issues/6821 Signed-off-by: Wesley Pettit --- src/flb_upstream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flb_upstream.c b/src/flb_upstream.c index af98cffa851..48d486b3660 100644 --- a/src/flb_upstream.c +++ b/src/flb_upstream.c @@ -436,7 +436,7 @@ static int prepare_destroy_conn(struct flb_connection *u_conn) flb_trace("[upstream] destroy connection #%i to %s:%i", u_conn->fd, u->tcp_host, u->tcp_port); - if (flb_stream_is_async(&u->base)) { + if (MK_EVENT_IS_REGISTERED((&u_conn->event))) { mk_event_del(u_conn->evl, &u_conn->event); }