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 E9C54200C53 for ; Tue, 7 Mar 2017 00:29:30 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id E74EF160B84; Mon, 6 Mar 2017 23:29:30 +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 8C9A0160B9D for ; Tue, 7 Mar 2017 00:29:28 +0100 (CET) Received: (qmail 21582 invoked by uid 500); 6 Mar 2017 23:29:26 -0000 Mailing-List: contact commits-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 commits@activemq.apache.org Received: (qmail 20711 invoked by uid 99); 6 Mar 2017 23:29:26 -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; Mon, 06 Mar 2017 23:29:26 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2A4DCDFF83; Mon, 6 Mar 2017 23:29:26 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tabish@apache.org To: commits@activemq.apache.org Date: Mon, 06 Mar 2017 23:29:55 -0000 Message-Id: <5315339de2fd4b648daf8e29a5b02f47@git.apache.org> In-Reply-To: <4eb312cf45504de28dfef7461a3790f9@git.apache.org> References: <4eb312cf45504de28dfef7461a3790f9@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [31/50] [abbrv] activemq-nms-stomp git commit: Trigger the fault tolerant recovery logic when a connection exception occurs. Fixes [AMQNET-371]. (See https://issues.apache.org/jira/browse/AMQNET-371) archived-at: Mon, 06 Mar 2017 23:29:31 -0000 Trigger the fault tolerant recovery logic when a connection exception occurs. Fixes [AMQNET-371]. (See https://issues.apache.org/jira/browse/AMQNET-371) Project: http://git-wip-us.apache.org/repos/asf/activemq-nms-stomp/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-nms-stomp/commit/07cda020 Tree: http://git-wip-us.apache.org/repos/asf/activemq-nms-stomp/tree/07cda020 Diff: http://git-wip-us.apache.org/repos/asf/activemq-nms-stomp/diff/07cda020 Branch: refs/heads/1.5.x Commit: 07cda020cd8a26bdb1e97c402344a86991140289 Parents: 8e02b74 Author: Jim Gomes Authored: Tue Feb 28 23:42:51 2012 +0000 Committer: Jim Gomes Committed: Tue Feb 28 23:42:51 2012 +0000 ---------------------------------------------------------------------- src/main/csharp/Connection.cs | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-nms-stomp/blob/07cda020/src/main/csharp/Connection.cs ---------------------------------------------------------------------- diff --git a/src/main/csharp/Connection.cs b/src/main/csharp/Connection.cs index 4ca6aa5..16f664a 100755 --- a/src/main/csharp/Connection.cs +++ b/src/main/csharp/Connection.cs @@ -721,14 +721,27 @@ namespace Apache.NMS.Stomp internal void OnException(Exception error) { - // Will fire an exception listener callback if there's any set. - OnAsyncException(error); + if(this.transport.IsFaultTolerant) + { + Tracer.ErrorFormat("Attempting recovery from Exception: {0}", error.Message); + while(null != (error = error.InnerException)) + { + Tracer.ErrorFormat(" {0}", error.Message); + } - if(!this.closing.Value && !this.closed.Value) + OnTransportInterrupted(this.transport); + } + else { - // Perform the actual work in another thread to avoid lock contention - // and allow the caller to continue on in its error cleanup. - executor.QueueUserWorkItem(AsyncOnExceptionHandler, error); + // Will fire an exception listener callback if there's any set. + OnAsyncException(error); + + if(!this.closing.Value && !this.closed.Value) + { + // Perform the actual work in another thread to avoid lock contention + // and allow the caller to continue on in its error cleanup. + executor.QueueUserWorkItem(AsyncOnExceptionHandler, error); + } } }