-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
TCP_USER_TIMEOUT property setting issue #11517
Comments
I'd expect NioSocketChannel to ignore the unknown (to it) option. Have you seen any error caused by this? |
Ah, okay. It would be good to avoid the warning. Although we don't know the type returned by the channelFactory, so it may be a bit hard to figure out which case we are in. Do you have any ideas on how to fix it? We could choose to avoid TCP_USER_TIMEOUT if someone sets the channelFactory on NettyChannelBuilder. |
I honestly don't know if that works. We could do it before connect(), which is good. But there's two risks:
Looking at the code, it seems Netty directly modifies the socket when called and socket is final. https://github.com/netty/netty/blob/7679b9efdec71b54d06db91eef40ad913681294a/transport-classes-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannelConfig.java#L161 Yeah, seems it could work. |
In NettyClientTransport, the TCP_USER_TIMEOUT attribute can be set only if the channel is of the AbstractEpollStreamChannel. Fixes #11517
The channelFactory may create a NioSocketChannel, but here it uses Utils.maybeGetTcpUserTimeoutOption() to determine whether to set the TCP_USER_TIMEOUT. It may lead to setting TCP_USER_TIMEOUT when using NioSocketChannel, but in fact, only EpollSocketChannel supports setting this property. I feel that the judgment here is not strict enough. Should we consider optimization?
The text was updated successfully, but these errors were encountered: