-
-
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
ClassCastException sometimes (very few times) with an encoder #1980
Comments
To me, it seems like you are trying to write something that is not Do you manipulate your pipeline dynamically? Then, there might be some race condition such as writing a message object before you insert your If you still think this is a bug in Netty, please feel free to reopen this issue with some test case or your pipeline setup + handler implementation. |
I write a EnhancedApnsNotification and expect my ApnsNotificationEncoder to encode it. I don't modify the pipeline on-the-fly, the only part I touch the pipeline s the channel initialization code. I can't reproduce it in a test case because it happens very few times (1-2 times in thousands of executions), and under circumstances I am yet to determine, but to me it looks like it's a netty bug. |
Then, could you please paste your channel initializer? |
getChannelHandlerProvider().getChannelHandlers() is here: |
@trustin you are looking into it ? For me it looks like the Encoder is somehow removed in between. I think the only way this could happen is when the channel closes as part of the ChannelPipeline cleanup ,but not sure how this could raise with the write here. |
I tried to reproduce the problem with the modified SecureChat example without success so far. I made the following modifications to the SecureChat example:
|
@normanmaurer That sounds like the right guess, looking from the log message? |
yeah I just wonder how it could race here... hmmm |
@flozano was you able to get more details on this ? |
Unfortunately no :( |
@flozano so it still happens ? If we could have some way to produce it would be quite easier :( |
No, we can't reproduce now. It happened VERY few times. |
@flozano I will close this for now ... please re-open if it still happens with the latest release and provide infos how to reproduce |
ApnsNotificationEncoder extends MessageToByteEncoder, registered and working 99,999% of the time, ApnsNotification is an interface implemented by EnhancedApnsNotification, and I only have one channel.write() in the whole code. Am I doing something wrong, or maybe there is a problem with matching interfaces/classes-implementing-interfaces in encoder pipeline?
The text was updated successfully, but these errors were encountered: