-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Support setting options of boss in NettyServer #6947
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
Support setting options of boss in NettyServer #6947
Conversation
|
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.
just out of curiosity, which options are you planning to use?
@@ -189,10 +190,21 @@ public NettyServerBuilder channelFactory(ChannelFactory<? extends ServerChannel> | |||
* Specifies a channel option. As the underlying channel as well as network implementation may | |||
* ignore this value applications should consider it a hint. | |||
* | |||
* @since 1.28.1 |
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.
1.29.0
branch cut is already done. it should 1.30.0
* @since 1.28.1 | |
* @since 1.30.0 |
@@ -175,6 +177,7 @@ public void childChannelOptions() throws Exception { | |||
NettyServer ns = new NettyServer( | |||
addr, | |||
new ReflectiveChannelFactory<>(NioServerSocketChannel.class), | |||
new HashMap<ChannelOption<?>, Object>(), | |||
channelOptions, |
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.
nit: can you rename this to childChannelOptions
to avoid confusion?
Hi, @creamsoup . Thanks for your comments. All of them has been patched. Many options related to the boss ELG will be set, mainly the SO_BACKLOG parameter, because this has been hard-coded to 128, which is not enough in my case. |
that's good to know. thanks. |
I don't have expertise to review this and getting its context takes time. Maybe request review from someone else? 😄 |
Hi, @creamsoup . As @voidzcy said, would you please ask others to check it out. |
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.
I changed the PR title to remove "worker" since worker configuration was already supported.
merged, thanks @asdf2014! |
And actually, it looks like us setting the SO_BACKLOG was just cargo-culting (that is some very old code). We should probably just remove it and use Netty's default, which is 200 on Windows and the system max on Linux (commonly 128). https://github.com/netty/netty/blob/0cde4d9cb4d19ddc0ecafc5be7c5f7c781a1f6e9/transport/src/main/java/io/netty/channel/socket/DefaultServerSocketChannelConfig.java#L44 |
Hi, @ejona86 . Thanks for your approval. I agree with you, we shouldn't hard code the value of SO_BACKLOG option in |
No description provided.