Skip to content

Add send_keepalive_packet option to out_forward plugin#5262

Open
2ZZ wants to merge 1 commit intofluent:masterfrom
2ZZ:add-tcp-keepalive-to-out-forward
Open

Add send_keepalive_packet option to out_forward plugin#5262
2ZZ wants to merge 1 commit intofluent:masterfrom
2ZZ:add-tcp-keepalive-to-out-forward

Conversation

@2ZZ
Copy link
Contributor

@2ZZ 2ZZ commented Feb 18, 2026

This PR adds the send_keepalive_packet configuration parameter to the out_forward plugin to enable TCP keepalive (SO_KEEPALIVE) on forward output connections.

Background

The existing keepalive parameter only enables connection pooling/reuse, not TCP-level keepalive probes. This can lead to accumulation of dead connections in CLOSE-WAIT state.

Changes

  • Added send_keepalive_packet config parameter (default: false)
  • Pass the parameter to both socket_create_tcp and socket_create_tls calls
  • Added tests to verify the parameter works correctly

Related

This follows the same pattern as #2352 which added the same feature to in_forward.

This adds the send_keepalive_packet configuration parameter to enable
TCP keepalive (SO_KEEPALIVE) on forward output connections, similar to
the implementation in in_forward (PR fluent#2352).

The existing 'keepalive' parameter only enables connection pooling,
not TCP-level keepalive probes.
@Watson1978
Copy link
Contributor

@2ZZ Can you add DCO sign in your commit and fix tests ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments