activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ARTEMIS-963) ClassCastException in ActiveMQChannelHandler
Date Wed, 15 Feb 2017 01:12:42 GMT

    [ https://issues.apache.org/jira/browse/ARTEMIS-963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15867040#comment-15867040
] 

ASF subversion and git services commented on ARTEMIS-963:
---------------------------------------------------------

Commit be370209641312c270176d7ac552d3f0e54ab555 in activemq-artemis's branch refs/heads/1.x
from [~jmesnil]
[ https://git-wip-us.apache.org/repos/asf?p=activemq-artemis.git;h=be37020 ]

[ARTEMIS-963] Prevent ClassCastException in ActiveMQChannelHandler

When HTTP Upgrade is enabled, update Netty's pipeline only after the
HTTP Upgrade handshake is successful *and* the trailing
EMPTY_LAST_CONTENT is received.
Otherwise, this EMPTY_LAST_CONTENT is handled by
ActiveMQChannelHandler which is only expected to handle ByteBuf

JIRA: https://issues.apache.org/jira/browse/ARTEMIS-963
(cherry picked from commit 992dc2bc1b613dcb788ae2b4d59dc098e3325610)


> ClassCastException in ActiveMQChannelHandler
> --------------------------------------------
>
>                 Key: ARTEMIS-963
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-963
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 1.5.2
>            Reporter: Jeff Mesnil
>
> In WildFly, we use Artemis HTTP upgrade to connect from the Artemis client to the server.
> We also have an older version of Netty (4.0.35.Final) than the one used by Artemis (4.1.5.Final).
> When I upgraded the version of Netty in WildFly to 4.1.5.Final, I found a regression
that is causing a ClassCastException in ActiveMQChannelHandler#channelRead where I received
a Netty's LastHttpContent.EMPTY_LAST_CONTENT instead of a ByteBuf.
> After some bisect, we found that the actual regression happened with Netty 4.0.37.Final
and this PR[1].
> Before Netty 4.0.37.Final, the pipeline was updated in HttpUpgradeHandler#channelRead0
when the HttpResponse (corresponding to the HTTP Upgrade 101 header). Then the following LastHttpContent.EMPTY_LAST_CONTENT
was also consumed by it (but we don't care, the handshake was complete and the latch was already
countdown).
> However, with Netty 4.0.37.Final, the LastHttpContent.EMPTY_LAST_CONTENT is now handled
after the pipeline was updated and it now received by ActiveMQChannelHandler#channelRead.
This causes the ClassCastException as this handler is only expecting ByteBuf.
> The code in HttpUpgradeHandler#channelRead0 must be updated so that the pipeline is updated
only when the HTTP ugprade handshake is successful *and* we consume the LastHttpContent.EMPTY_LAST_CONTENT
that is added by Netty
> [1] https://github.com/netty/netty/pull/5110



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message