Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id F096F200C2A for ; Wed, 15 Feb 2017 02:12:48 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id EF303160B6D; Wed, 15 Feb 2017 01:12:48 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4627C160B5F for ; Wed, 15 Feb 2017 02:12:48 +0100 (CET) Received: (qmail 72026 invoked by uid 500); 15 Feb 2017 01:12:47 -0000 Mailing-List: contact issues-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list issues@activemq.apache.org Received: (qmail 72017 invoked by uid 99); 15 Feb 2017 01:12:47 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Feb 2017 01:12:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id E6155C144F for ; Wed, 15 Feb 2017 01:12:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.199 X-Spam-Level: X-Spam-Status: No, score=-1.199 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 4wUB1Bx2nMQz for ; Wed, 15 Feb 2017 01:12:46 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 7FE405F659 for ; Wed, 15 Feb 2017 01:12:45 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 30946E0416 for ; Wed, 15 Feb 2017 01:12:43 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 48D322411D for ; Wed, 15 Feb 2017 01:12:42 +0000 (UTC) Date: Wed, 15 Feb 2017 01:12:42 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: issues@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ARTEMIS-963) ClassCastException in ActiveMQChannelHandler MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 15 Feb 2017 01:12:49 -0000 [ https://issues.apache.org/jira/browse/ARTEMIS-963?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D158= 67039#comment-15867039 ]=20 ASF subversion and git services commented on ARTEMIS-963: --------------------------------------------------------- Commit be370209641312c270176d7ac552d3f0e54ab555 in activemq-artemis's branc= h refs/heads/1.x from [~jmesnil] [ https://git-wip-us.apache.org/repos/asf?p=3Dactivemq-artemis.git;h=3Dbe37= 020 ] [ARTEMIS-963]=C2=A0Prevent 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 clien= t to the server. > We also have an older version of Netty (4.0.35.Final) than the one used b= y 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 i= nstead of a ByteBuf. > After some bisect, we found that the actual regression happened with Nett= y 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 con= sumed by it (but we don't care, the handshake was complete and the latch wa= s 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 Active= MQChannelHandler#channelRead. This causes the ClassCastException as this ha= ndler is only expecting ByteBuf. > The code in HttpUpgradeHandler#channelRead0 must be updated so that the p= ipeline 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)