-
-
Notifications
You must be signed in to change notification settings - Fork 15.8k
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
More correct fix for using ChannelInitializer with custom EventExecutor. #8633
Conversation
Motivation: 8331248 did make some changes to fix a race in ChannelInitializer when using with a custom EventExecutor. Unfortunally these where a bit racy and so the testcase failed sometimes. Modifications: - More correct fix when using a custom EventExecutor - Adjust the testcase to be more correct. Result: Proper fix for #8616.
ChannelPipeline pipeline = ctx.pipeline(); | ||
if (pipeline.context(this) != null) { | ||
pipeline.remove(this); | ||
} | ||
} | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
private void remove(final ChannelHandlerContext ctx) { |
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 is a confusing name now. Call it removeState
or clearState
?
@@ -79,6 +79,9 @@ public final void channelRegistered(ChannelHandlerContext ctx) throws Exception | |||
// we called initChannel(...) so we need to call now pipeline.fireChannelRegistered() to ensure we not | |||
// miss an event. | |||
ctx.pipeline().fireChannelRegistered(); | |||
|
|||
// We are done with init the Channel, removing the initializer now. |
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 comment seems to be wrong. The initializer was already removed in initChannel.
@ejona86 addressed |
…or. (#8633) Motivation: 8331248 did make some changes to fix a race in ChannelInitializer when using with a custom EventExecutor. Unfortunally these where a bit racy and so the testcase failed sometimes. Modifications: - More correct fix when using a custom EventExecutor - Adjust the testcase to be more correct. Result: Proper fix for #8616.
Motivation:
8331248 did make some changes to fix a race in ChannelInitializer when using with a custom EventExecutor. Unfortunally these where a bit racy and so the testcase failed sometimes.
Modifications:
Result:
Proper fix for #8616.