From cc1280b161c0e9249deb9eee5b51dd5c86f6f299 Mon Sep 17 00:00:00 2001 From: Matthew Fala <34408404+matthewfala@users.noreply.github.com> Date: Fri, 4 Mar 2022 16:46:46 -0800 Subject: [PATCH] upstream: avoid dns timeout null event injection (#4956) Signed-off-by: Matthew Fala --- src/flb_upstream.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/flb_upstream.c b/src/flb_upstream.c index 0445f29f0da..3fd487bdb9d 100644 --- a/src/flb_upstream.c +++ b/src/flb_upstream.c @@ -842,10 +842,11 @@ int flb_upstream_conn_timeouts(struct mk_list *list) } if (drop == FLB_TRUE) { - mk_event_inject(u_conn->evl, &u_conn->event, - MK_EVENT_READ | MK_EVENT_WRITE, - FLB_TRUE); - + if (u_conn->event.status != MK_EVENT_NONE) { + mk_event_inject(u_conn->evl, &u_conn->event, + MK_EVENT_READ | MK_EVENT_WRITE, + FLB_TRUE); + } u_conn->net_error = ETIMEDOUT; prepare_destroy_conn(u_conn); }