activemq-issues mailing list archives

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


ASF subversion and git services commented on ARTEMIS-963:

Commit be370209641312c270176d7ac552d3f0e54ab555 in activemq-artemis's branch refs/heads/1.x
from [~jmesnil]
[;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
Otherwise, this EMPTY_LAST_CONTENT is handled by
ActiveMQChannelHandler which is only expected to handle ByteBuf

(cherry picked from commit 992dc2bc1b613dcb788ae2b4d59dc098e3325610)

> ClassCastException in ActiveMQChannelHandler
> --------------------------------------------
>                 Key: ARTEMIS-963
>                 URL:
>             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
> 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]

This message was sent by Atlassian JIRA

View raw message