Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 03B6E180E4 for ; Fri, 31 Jul 2015 11:06:05 +0000 (UTC) Received: (qmail 32918 invoked by uid 500); 31 Jul 2015 11:06:04 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 32880 invoked by uid 500); 31 Jul 2015 11:06:04 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 32870 invoked by uid 99); 31 Jul 2015 11:06:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Jul 2015 11:06:04 +0000 Date: Fri, 31 Jul 2015 11:06:04 +0000 (UTC) From: "Claus Ibsen (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (CAMEL-9035) unbind smpp connection bug MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAMEL-9035?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Claus Ibsen reassigned CAMEL-9035: ---------------------------------- Assignee: Claus Ibsen > unbind smpp connection bug > --------------------------- > > Key: CAMEL-9035 > URL: https://issues.apache.org/jira/browse/CAMEL-9035 > Project: Camel > Issue Type: Bug > Components: camel-smpp > Affects Versions: 2.14.0, 2.15.2 > Reporter: imran raza khan > Assignee: Claus Ibsen > Labels: patch > Fix For: 2.15.2, 2.16.0 > > > Suppose SMSC allowed one connection to client and due to any reason if session.unbindAndClose failed it will set session to null and dont retry to unbind. > Connection/Session will remain open on SMSC till its TransactionTimeOut, mostly SMSc Admin set it to 5 to 10 mins. > Following are snippet of org.apache.camel.component.smpp.SmppProducer and details are like > 1- if for any reason Camel try to unbind connection and it got failed below code print log and set session=null in both success/fail cases. > 2- After sending unbind it will try to reconnect. > 3- As SMSc allowed 1 connection which was not unbinded successfull it will not allowed second connection so reconnect will get failed. > 4- Camel call closesession on reconnection failure and will verify if session != null, as session is already null so this code will not send unbind again and apache camel will not able to get connection from SMSc until timeout happen on SMSc and this will results in 10 mins outage. > If we change closeSession() like below > current: > {code} > private void closeSession() { > if (session != null) { > session.removeSessionStateListener(this.internalSessionStateListener); > try { > Thread.sleep(1000); > session.unbindAndClose(); > } catch (Exception e) { > LOG.warn("Could not close session " + session); > } > session = null; > } > } > {code} > Suggested: > {code} > private void closeSession() { > if (session != null) { > session.removeSessionStateListener(this.internalSessionStateListener); > try { > Thread.sleep(1000); > session.unbindAndClose(); > session = null; // if we put here then it will retry for unbind > } catch (Exception e) { > LOG.warn("Could not close session " + session); > } > session = null; // remove his line > } > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)