Skip to content
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

Merged
merged 2 commits into from
Dec 7, 2018

Conversation

normanmaurer
Copy link
Member

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:

- 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) {
Copy link
Member

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.
Copy link
Member

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.

@normanmaurer
Copy link
Member Author

@ejona86 addressed

@normanmaurer normanmaurer merged commit a564b70 into 4.1 Dec 7, 2018
@normanmaurer normanmaurer added this to the 4.1.33.Final milestone Dec 7, 2018
@normanmaurer normanmaurer deleted the init_fix branch December 7, 2018 18:12
normanmaurer added a commit that referenced this pull request Dec 7, 2018
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants