[
https://issues.apache.org/jira/browse/ARTEMIS-963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
clebert suconic closed ARTEMIS-963.
-----------------------------------
> 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
> Fix For: 1.5.4, 2.0.0
>
>
> 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.4.14#64029)