You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "edge wang (JIRA)" <ji...@apache.org> on 2012/06/10 05:02:42 UTC
[jira] [Commented] (CAMEL-5225) camel-netty can't distinguish
between Sharable and Unsharable codecs
[ https://issues.apache.org/jira/browse/CAMEL-5225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13292466#comment-13292466 ]
edge wang commented on CAMEL-5225:
----------------------------------
Would you please adopt my revised UnsharableCodecsConflictsTest.java and run the test? I only saw the code somewhat reverted to version 2.9.1, but didn't solve the problem I reported. The problem exists as long as you use code like this(DefaultServerPipelineFactory.java):
List<ChannelUpstreamHandler> decoders = consumer.getConfiguration().getDecoders();
for (int x = 0; x < decoders.size(); x++) {
channelPipeline.addLast("decoder-" + x, decoders.get(x));
}
this configuration model causes the decoders(created and cached in consumer.getConfiguration().getDecoders()) to be shared among pinelines and then lead to conflicts on stateful codecs.
> camel-netty can't distinguish between Sharable and Unsharable codecs
> --------------------------------------------------------------------
>
> Key: CAMEL-5225
> URL: https://issues.apache.org/jira/browse/CAMEL-5225
> Project: Camel
> Issue Type: Bug
> Components: camel-netty
> Affects Versions: 2.9.2
> Environment: ALL
> Reporter: edge wang
> Assignee: Claus Ibsen
> Labels: netty
> Fix For: 2.9.3, 2.10.0
>
> Attachments: DefaultServerPipelineFactory.java.patch, UnsharableCodecsConflictsTest.java, UnsharableCodecsConflictsTest.java
>
>
> Camel-netty uses general configuration model for referenced encoders/decoders for channel pipelines, see DefaultServerPipelineFactory. That is, create encoder/decoder objects at configuration parsing time and store them in a list, then use them when a pipeline is established. However, this will make encoder/decoder objects shared among different pipelines, that may cause data conflicts, when the encoder/decoder is not Sharable(has object status/not annotated as @Sharable), e.g. a LengthFieldBasedFrameDecoder.
> Although we can avoid the problem by totally writing a new serverpipelinefactory for our apps, several problem still remains, please see detailed description and testcase for this bug at:
> http://camel.465427.n5.nabble.com/camel-netty-bug-and-the-need-of-best-practice-for-creating-referenced-parameter-object-on-looking-up-td5627926.html
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira