-
-
Notifications
You must be signed in to change notification settings - Fork 16.1k
Fix SelectableChannel support in NioEventLoop #8344
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
Conversation
Can one of the admins verify this patch? |
35b7157
to
80981e1
Compare
} | ||
}); | ||
|
||
latch.await(); |
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.
Await with timeout?
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.
That could be done, but please note that I set a timeout on the @Test
annotation so that the whole test case will fail in case of a timeout.
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.
Works for me.
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.
|
||
latch.await(); | ||
} finally { | ||
group.shutdownGracefully(); |
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.
Also close the channels ?
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.
Good catch! Fixed.
Motivation: Unless the 'io.netty.noKeySetOptimization' system property is set, registering a SelectableChannel instance to a NioEventLoop results in a ClassCastException: io.netty.channel.nio.SelectedSelectionKeySetSelector cannot be cast to java.nio.channels.spi.AbstractSelector Modifications: Instead of 'selector', pass 'unwrappedSelector' to SelectableChannel. Result: It is possible to register a SelectableChannel instance without setting the 'io.netty.noKeySetOptimization' system property.
80981e1
to
243b904
Compare
@normanmaurer We just signed the CCLA. |
@jvirtanen merged... thx |
Motivation:
Unless the
io.netty.noKeySetOptimization
system property is set, registering a SelectableChannel instance to a NioEventLoop results in a ClassCastException:Modifications:
Instead of
selector
, passunwrappedSelector
to SelectableChannel.Result:
It is possible to register a SelectableChannel instance without setting the
io.netty.noKeySetOptimization
system property.