Skip to content

out_forward: do not use SO_LINGER on Windows#2398

Merged
repeatedly merged 1 commit into
fluent:masterfrom
fujimotos:sf/forward-tls-win32
Apr 25, 2019
Merged

out_forward: do not use SO_LINGER on Windows#2398
repeatedly merged 1 commit into
fluent:masterfrom
fujimotos:sf/forward-tls-win32

Conversation

@fujimotos

Copy link
Copy Markdown
Contributor

Which issue(s) this PR fixes:
Fixes #1968

What this PR does / why we need it:

There is an obscure bug in out_forward that prevents events from
being sent to a remote node. It occures only on Windows, and is
reproducable only when SSL/TLS is enabled.

The root cause is not fully investigated yet, but disabling
SO_LINGER is confirmed to fix the issue. So this implements it.

Docs Changes:

Not required

Release Note:

"out_forward: fix data loss when SSL/TLS is enabled on Windows "

There is an obscure bug in out_forward that prevents events from
being sent to a remote node. It occures only on Windows, and is
reproducable only when SSL/TLS is enabled.

The root cause is not fully investigated yet, but disabling
SO_LINGER is confirmed to fix the issue. So this implements it.

Signed-off-by: Fujimoto Seiji <fujimoto@clear-code.com>
@repeatedly repeatedly merged commit 30ee851 into fluent:master Apr 25, 2019
@repeatedly

Copy link
Copy Markdown
Member

Thanks!

@michaelsteiner

Copy link
Copy Markdown

This fix is included in Fluentd 1.5.0 according to https://github.com/fluent/fluentd/blob/master/CHANGELOG.md.
According to https://support.treasuredata.com/hc/en-us/articles/360001479187-The-td-agent-ChangeLog, td-agent (.msi package for Windows) 3.4.1 is still based on Fluentd 1.4.2.

=> When will an .msi package for Windows be available that includes this fix? (Say, newer than td-agent-3.4.1-0-x64.msi that is currently available on https://td-agent-package-browser.herokuapp.com/3/windows )

@repeatedly

Copy link
Copy Markdown
Member

Next td-agent, 3.5.0, will be released late july or early august.
If you want to use newer version in msi package, gem update is one way.

@michaelsteiner

Copy link
Copy Markdown

Next td-agent, 3.5.0, will be released late july or early august.
If you want to use newer version in msi package, gem update is one way.

Thanks a lot for your fast response. The following update worked for me:

Download https://rubygems.org/downloads/fluentd-1.5.2-x64-mingw32.gem and install it with
fluent-gem install --force --local *.gem

cosmo0920 added a commit that referenced this pull request Mar 9, 2020
[The previous commit](7d16531) solved linger_timeout member types glitch.
In the previous linger_timeout behavior is always occurring dropping data.
But the fixing member type glitches, Fluentd can handle linger_timeout on Windows.
This type glitch causes overflow and then linger_timeout should be 0.
So, this is why specifying linger_timeout causes data loss on Windows.

LIBC: { int l_onoff; int l_linger; } # I!I!
Winsock: { u_short l_onoff; u_short l_linger; } #S!S!

Really fixes for #1968.
Reverted #2398

Signed-off-by: Hiroshi Hatake <hatake@clear-code.com>
@fujimotos fujimotos deleted the sf/forward-tls-win32 branch October 9, 2022 06:17
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.

Encryption support on out_forwarder plugin in Windows (Fluentd 1.0.2)

3 participants