Skip to content

Commit

Permalink
output: set tcp keepalive flag when desired
Browse files Browse the repository at this point in the history
Update the stream keepalive flag to match the net keepalive setting.
This is required for the upstream connection to get recycled

Signed-off-by: Ben Chess <[email protected]>
  • Loading branch information
bchess authored and edsiper committed Nov 7, 2023
1 parent 13b2ec0 commit 5be576e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/flb_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,10 @@ int flb_output_upstream_set(struct flb_upstream *u, struct flb_output_instance *
flags |= FLB_IO_TCP_KA;
}

if (ins->net_setup.keepalive == FLB_TRUE) {
flags |= FLB_IO_TCP_KA;
}

/* Set flags */
flb_stream_enable_flags(&u->base, flags);

Expand Down

0 comments on commit 5be576e

Please sign in to comment.