Skip to content

Commit 1938ec8

Browse files
committed
upstream: put timed out busy connection on destroy queue
Signed-off-by: Eduardo Silva <[email protected]>
1 parent 961ed61 commit 1938ec8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/flb_upstream.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ int flb_upstream_conn_timeouts(struct mk_list *list)
649649
}
650650

651651
/* Iterate every busy connection */
652-
mk_list_foreach(u_head, &uq->busy_queue) {
652+
mk_list_foreach_safe(u_head, tmp, &uq->busy_queue) {
653653
u_conn = mk_list_entry(u_head, struct flb_upstream_conn, _head);
654654

655655
drop = FLB_FALSE;
@@ -674,6 +674,7 @@ int flb_upstream_conn_timeouts(struct mk_list *list)
674674
*/
675675
shutdown(u_conn->fd, SHUT_RDWR);
676676
u_conn->net_error = ETIMEDOUT;
677+
prepare_destroy_conn(u_conn);
677678
}
678679
}
679680

0 commit comments

Comments
 (0)