-
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
server helper: Fix IPv6 dual stack mode issue for tcp socket. #2697
Conversation
Signed-off-by: Masahiro Nakagawa <[email protected]>
Don't you add a test for this? |
Signed-off-by: Masahiro Nakagawa <[email protected]>
Signed-off-by: Masahiro Nakagawa <[email protected]>
Just added test. |
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.
LGTM if the CI passes. And left a question.
lib/fluent/plugin_helper/server.rb
Outdated
@@ -355,7 +355,11 @@ def server_create_tcp_socket(shared, bind, port) | |||
sock = if shared | |||
server_socket_manager_client.listen_tcp(bind, port) | |||
else | |||
TCPServer.new(bind, port) # this method call can create sockets for AF_INET6 | |||
# TCPServer.new doesn't set IPV6_V6ONLY flag, so use Addrinfo class instead. | |||
# backlog will be set correctly so use listen's default here |
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.
backlog will be set correctly
What does this mean? who sets backlog?
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.
server_create_tcp_socket
is used in other API, e.g. server_create, and such APIs set backlog from plugins.
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.
This one? https://github.com/fluent/fluentd/blob/master/lib/fluent/plugin_helper/server.rb#L222
How about "backlog will be set by the caller, we don't set backlog here", then? (it's IMO. so it's ok for me to leave as it is)
Signed-off-by: Masahiro Nakagawa <[email protected]>
d04d397
to
29b5176
Compare
Signed-off-by: Masahiro Nakagawa [email protected]
Which issue(s) this PR fixes:
Fixes #2682
What this PR does / why we need it:
Use other socket method to set
IPV6_V6ONLY
.See also treasure-data/serverengine#101
Docs Changes:
No need
Release Note:
Same as title