Add send_keepalive_packet option to out_forward plugin#5262
Add send_keepalive_packet option to out_forward plugin#52622ZZ wants to merge 1 commit intofluent:masterfrom
Conversation
|
@2ZZ Can you add DCO sign in your commit and fix tests ? |
7b60a69 to
2c5860d
Compare
Fixed and signed. One test failed but it doesn't look related to my change (https://github.com/fluent/fluentd/actions/runs/22176445014/job/64126271546?pr=5262#step:6:5177) |
There was a problem hiding this comment.
I think send_keepalive_packet should only be set to true when keepalive is set to true.
Like:
fluentd/lib/fluent/plugin/in_forward.rb
Lines 155 to 157 in 1327bed
Can you fix this and add tests for that, like following ?
fluentd/test/plugin/test_in_forward.rb
Lines 107 to 114 in 1327bed
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. Signed-off-by: Ian Driver <idriver@williamhill.us>
2c5860d to
c8b647a
Compare
Makes sense, updated now & tests passed |
Which issue(s) this PR fixes:
Fixes #
What this PR does / why we need it:
This PR adds the
send_keepalive_packetconfiguration parameter to theout_forwardplugin to enable TCP keepalive (SO_KEEPALIVE) on forward output connections.Background:
The existing
keepaliveparameter only enables connection pooling/reuse, not TCP-level keepalive probes. This can lead to accumulation of dead connections in CLOSE-WAIT state.Changes:
send_keepalive_packetconfig parameter (default: false)socket_create_tcpandsocket_create_tlscallsRelated:
This follows the same pattern as #2352 which added the same feature to
in_forward.Docs Changes:
Release Note:
send_keepalive_packetoption