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 4789D200C45 for ; Tue, 28 Mar 2017 14:00:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 46213160B89; Tue, 28 Mar 2017 12:00:08 +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 8C67D160B7E for ; Tue, 28 Mar 2017 14:00:07 +0200 (CEST) Received: (qmail 81820 invoked by uid 500); 28 Mar 2017 12:00:01 -0000 Mailing-List: contact dev-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 dev@activemq.apache.org Received: (qmail 81440 invoked by uid 99); 28 Mar 2017 12:00:01 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Mar 2017 12:00:01 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 58A57DFF47; Tue, 28 Mar 2017 12:00:01 +0000 (UTC) From: gemmellr To: dev@activemq.apache.org Reply-To: dev@activemq.apache.org References: In-Reply-To: Subject: [GitHub] activemq-artemis pull request #1140: ARTEMIS-1056 Better event processing Content-Type: text/plain Message-Id: <20170328120001.58A57DFF47@git1-us-west.apache.org> Date: Tue, 28 Mar 2017 12:00:01 +0000 (UTC) archived-at: Tue, 28 Mar 2017 12:00:08 -0000 Github user gemmellr commented on a diff in the pull request: https://github.com/apache/activemq-artemis/pull/1140#discussion_r108398829 --- Diff: artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ProtonHandler.java --- @@ -322,17 +308,22 @@ private void dispatch() { // because we could have a distributed deadlock // while processing events (for instance onTransport) // while a client is also trying to write here - while ((ev = popEvent()) != null) { - for (EventHandler h : handlers) { - if (log.isTraceEnabled()) { - log.trace("Handling " + ev + " towards " + h); - } - try { - Events.dispatch(ev, h); - } catch (Exception e) { - log.warn(e.getMessage(), e); - connection.setCondition(new ErrorCondition()); + + synchronized (lock) { + while ((ev = collector.peek()) != null) { + for (EventHandler h : handlers) { + if (log.isTraceEnabled()) { + log.trace("Handling " + ev + " towards " + h); + } + try { + Events.dispatch(ev, h); + } catch (Exception e) { + log.warn(e.getMessage(), e); + connection.setCondition(new ErrorCondition()); --- End diff -- Its not clear what the intent is here (and in similar snippet further down the method), but I'm not sure this will be having the desired effect. Setting a brand new ErrorCondition like this will effectively clear any error details for the connection, which are actually the condition/description/info-map details stored inside an ErrorCondition object, which will be empty for the new instance. Setting a condition inside the ErrorCondition doesn't itself lead to it being sent, the endpoint subsequently needs closed before the details are included in the detach/end/close frame then being sent. The connection may not be the right endpoint to set an error, e.g it might be a particular link receiving a delivery event and so that link might be the endpoint to update. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---