-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add keep alive to tcp plugin #3961
Conversation
Signed-off-by: I326463 <[email protected]>
7890c20
to
488f942
Compare
@fujimotos could you please approve running the workflows? |
@dimitarKiryakov Thank you for contribution!
I eyeballed your patch. It seems good, but I want to do a bit of more
BTW, I approved the workflow run. The tests have just started running. |
Signed-off-by: I326463 <[email protected]>
038c6c2
to
a1717b4
Compare
@fujimotos Thanks a lot for your help on this. This feature is very crucial for us as it will mitigate the issue of dead connections. I think that the currently failing tests are not related to my change. Did you manage to test it? Thank you a lot! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. I can confirm this patch works.
Here is how I tested this patch. First, I created a simple TCP server $ fluentd -c tcp.conf I initiated a TCP connection to the server in another terminal, and kept $ telnet localhost 9000 Then I monitored the network stream using $ tcpdump
...
14:20:21.470600 IP 127.0.0.1.40446 > 127.0.0.1.9000: Flags [.], ack 1, win 512, options [nop,nop,TS val 1282790546 ecr 1282790546], length 0
14:21:22.182178 IP 127.0.0.1.9000 > 127.0.0.1.40446: Flags [.], ack 1, win 512, options [nop,nop,TS val 1282851258 ecr 1282790546], length 0
14:21:22.182196 IP 127.0.0.1.40446 > 127.0.0.1.9000: Flags [.], ack 1, win 512, options [nop,nop,TS val 1282851258 ecr 1282790546], length 0
14:22:23.622148 IP 127.0.0.1.9000 > 127.0.0.1.40446: Flags [.], ack 1, win 512, options [nop,nop,TS val 1282912698 ecr 1282851258], length 0 As shown above, keepalive packets are being transmitted after some tcp.conf <source>
@type tcp
port 9000
format none
tag "test.log"
send_keepalive_packet true
</source>
<match test.**>
@type stdout
</match> |
Merged via 66c4a8b. Note: I described more details in the commit message and also |
See fluent/fluentd#3961 Signed-off-by: Fujimoto Seiji <[email protected]>
See fluent/fluentd#3961 Signed-off-by: Fujimoto Seiji <[email protected]>
Documentation added in fluent/fluentd-docs-gitbook#438 |
Which issue(s) this PR fixes:
Fixes #3960
What this PR does / why we need it:
TCP keepalive should be supported by in_tcp to avoid dead connection, as same as in_forward
Docs Changes:
send_keepalive_packet should be added to https://docs.fluentd.org/input/tcp
Release Note:
Same with the title