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
Netty 5.0 swallowing exceptions #4721
Comments
exceptionCaught(...) is only called for inbound exceptions. All outbound exceptions must by handled in a listener by design. If you always want to have exceptions handled in exceptionCaught(...) just add a ChannelOutboundHandler that will an listener for every outbound operation |
@normanmaurer |
And 5.0 was deprecated completly atm. Use 4.1 in which ChannelOutboundHandler was not deprecated. (In 5.0 you would have used ChannelHandler directly)
|
How is 5.0 "deprecated completely"? Is it not the next Alpha version? |
No we not plan to work on 5.0 any time soon but concentrate on 4.0 and 4.1. All none breaking changes were backported to 4.1
|
Sad, I liked the changes that occurred in 5.0. |
Can you list which ones and for what reason?
|
The refactoring to use Java's Executor APIs a little more. Allows better interoperability between different libraries. That was a big one. Call me crazy, but pipeline nodes should be agnostic to whether the data they're working on is inbound/outbound. Netty 5.0 started to move towards that I feel like. One step further would be to explicitly specify which part of the duplex stream a pipeline handler should be put on (a simple approach to this would be two pipelines). Having two streams (inbound/outbound) in the same "stack" (pipeline) gets confusing, and doing automagic determination as to which handlers should be called for inbound/outbound data makes the API a bit messier. I imagine it would reduce under-the-hood code as well, and thus even performance (I speculate) since you don't have to determine which handlers should be fired for each message. |
Perhaps this is user error, but this is completely unintuitive in my opinion. Just sat here debugging something for a few hours; turns out Netty has been swallowing a bunch of exceptions, even when
exceptionCaught
was overridden.The following code produces no output, and the server being connected to gets no data (it does, however, receive a connection).
Am I missing something here? Adding a future listener and checking
.isSuccess()
works as expected...However if there isn't a listener, things should crash or
exceptionCaught
should be called. This is particularly useful in cases where a step shouldn't fail. What if a listener hasn't been added? This makes debugging an absolute nightmare to the point I would never want to use Netty in production.The text was updated successfully, but these errors were encountered: