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

Let CombinedChannelDuplexHandler correctly handle exceptionCaught. Re… #4702

Closed
wants to merge 1 commit into from

Conversation

normanmaurer
Copy link
Member

…lated to [#4528]

Motivation:

ChannelInboundHandler and ChannelOutboundHandler both can implement exceptionCaught(...) method and so we need to dispatch to both of them.

Modifications:

  • Correctly first dispatch exceptionCaught to the ChannelInboundHandler but also make sure the next handler it will be dispatched to will be the ChannelOutboundHandler
  • Add removeInboundHandler() and removeOutboundHandler() which allows to remove one of the combined handlers
  • Let *Codec extends it and not ChannelHandlerAppender

Result:

Correctly handle events and also have same behavior as in 4.0

…lated to [#4528]

Motivation:

ChannelInboundHandler and ChannelOutboundHandler both can implement exceptionCaught(...) method and so we need to dispatch to both of them.

Modifications:

- Correctly first dispatch exceptionCaught to the ChannelInboundHandler but also make sure the next handler it will be dispatched to will be the ChannelOutboundHandler
- Add removeInboundHandler() and removeOutboundHandler() which allows to remove one of the combined handlers
- Let *Codec extends it and not ChannelHandlerAppender

Result:

Correctly handle events and also have same behavior as in 4.0
@normanmaurer normanmaurer added this to the 4.1.0.CR1 milestone Jan 13, 2016
@normanmaurer normanmaurer self-assigned this Jan 13, 2016
@normanmaurer
Copy link
Member Author

@trustin @slandelle PTAL... I think this is a better fix .

@trustin I would even propose we remove ChannelHandlerAppender for now

@trustin
Copy link
Member

trustin commented Jan 14, 2016

Would this work when an inboundHandler or an outboundHandler also implements ChannelOutboundHandler or ChannelInboundHandler respectively?

@normanmaurer
Copy link
Member Author

@trustin I think I could make it work yes... I just wanted to have a "quick fix" first. Once this is merged I could also try to make it work for the case you just mentioned. WDYT ?

@normanmaurer
Copy link
Member Author

@trustin so at the moment it just support that it is either inbound or outbound handler (just as it was before).

@slandelle
Copy link
Contributor

@normanmaurer tested against AHC test suite, all green!

@trustin
Copy link
Member

trustin commented Jan 18, 2016

@normanmaurer Could you add some sanity checks then? i.e. rejecting an inbound handler that implements ChannelOutboundHandler (and vice versa)

@trustin
Copy link
Member

trustin commented Jan 18, 2016

@normanmaurer LGTM sans the missing sanity checks.

@normanmaurer
Copy link
Member Author

@trustin huh... we already check this:

https://github.com/netty/netty/blob/combined_duplex/transport/src/main/java/io/netty/channel/CombinedChannelDuplexHandler.java#L71

Also what you think about my other comment about removing ChannelHandlerAppender for now ?

@trustin
Copy link
Member

trustin commented Jan 18, 2016

@normanmaurer Ugh, you're right. :-) LGTM then! and yeah, let's remove ChannelHandlerAppender for good.

@normanmaurer
Copy link
Member Author

Cherry-picked into 4.0 (d7d6413) and 4.1 (e969b69)

@normanmaurer normanmaurer modified the milestones: 4.0.34.Final, 4.1.0.CR1 Jan 18, 2016
@normanmaurer normanmaurer deleted the combined_duplex branch January 18, 2016 09:13
@Scottmitch
Copy link
Member

@normanmaurer - lgtm! I have no objection for removing ChannelHandlerAppender. IIRC it currently needs work in other classes (defaultpipeline, etc...) to function "as intended" anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants