Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C11E293D7 for ; Sat, 29 Oct 2011 21:45:53 +0000 (UTC) Received: (qmail 3190 invoked by uid 500); 29 Oct 2011 21:45:53 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 3159 invoked by uid 500); 29 Oct 2011 21:45:53 -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 3151 invoked by uid 99); 29 Oct 2011 21:45:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Oct 2011 21:45:53 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Oct 2011 21:45:52 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 4302432771E for ; Sat, 29 Oct 2011 21:45:32 +0000 (UTC) Date: Sat, 29 Oct 2011 21:45:32 +0000 (UTC) From: "Timothy Bish (Resolved) (JIRA)" To: dev@activemq.apache.org Message-ID: <1599281334.37402.1319924732275.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <907416601.5324.1318925650924.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Resolved] (AMQ-3547) Calling Connection.close() on interrupted thread generates InterruptedIOException and leaks Connection MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMQ-3547?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:all-tabpanel ] Timothy Bish resolved AMQ-3547. ------------------------------- Resolution: Fixed Fix Version/s: 5.6.0 Fix applied in trunk, thanks for getting the test going. =20 > Calling Connection.close() on interrupted thread generates InterruptedIOE= xception and leaks Connection > -------------------------------------------------------------------------= ----------------------------- > > Key: AMQ-3547 > URL: https://issues.apache.org/jira/browse/AMQ-3547 > Project: ActiveMQ > Issue Type: Bug > Components: JMS client > Affects Versions: 5.5.0 > Reporter: Martin Ber=C3=A1nek > Assignee: Timothy Bish > Priority: Critical > Fix For: 5.6.0 > > Attachments: AMQ3529Test.java, AMQ3529Test.java > > > Similar to https://issues.apache.org/jira/browse/AMQ-3529 > call close() method on connection raise JMSException with InterruptedIOEx= ception as cause > Sample program: > public static void main(String[] args) throws Exception { > =09ConnectionFactory connectionFactory =3D new ActiveMQConnectionFactory(= "tcp://localhost:61616"); > =09Connection connection =3D connectionFactory.createConnection(); > =09Session session =3D connection.createSession(false, Session.AUTO_ACKNO= WLEDGE); > =09final Thread mainThread =3D Thread.currentThread(); > =09new Thread() { > =09=09public void run() { > =09=09=09// this thread interrupt main thread after 1s > =09=09=09try { > =09=09=09=09Thread.sleep(1000); > =09=09=09} catch (InterruptedException e) { > =09=09=09} > =09=09=09mainThread.interrupt(); > =09=09}; > =09}.start(); > =09try { > =09=09//wait for interrupt > =09=09Thread.sleep(10000); > =09} catch (InterruptedException e) { > =09=09Thread.currentThread().interrupt(); > =09} > =09try { > =09=09// this generate exception - bug??? > =09=09connection.close(); > =09} catch (JMSException e) { > =09=09e.printStackTrace(); > =09} > =09// non-daemon thread responsible for connection still running, program > =09// will not terminate > } > when I remove line with Session obtain, everything works OK -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira