Skip to content

Commit

Permalink
connection: a shutdown guard flag was added
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Alminana <[email protected]>
  • Loading branch information
leonardo-albertovich authored and EC2 Default User committed May 22, 2024
1 parent 164c2b0 commit 1769903
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/fluent-bit/flb_upstream_conn.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ struct flb_upstream_conn {
*/
int busy_flag;

/* This flag is used to determine if the connection was shut down to ensure we
* don't do it twice when a timeout is detected.
*
* This is required in order to overcome a limitation in the async read / write
* functions that will be addressed as soon as possible.
*/
int shutdown_flag;

/* Timestamps */
time_t ts_assigned;
time_t ts_created;
Expand Down
2 changes: 2 additions & 0 deletions src/flb_upstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,8 @@ static struct flb_upstream_conn *create_conn(struct flb_upstream *u)
conn->ts_available = 0;
conn->ka_count = 0;
conn->coro = coro;
conn->busy_flag = FLB_FALSE;
conn->shutdown_flag = FLB_FALSE;

if (u->net.keepalive == FLB_TRUE) {
flb_upstream_conn_recycle(conn, FLB_TRUE);
Expand Down

0 comments on commit 1769903

Please sign in to comment.