Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 11908 invoked from network); 17 Oct 2007 21:41:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Oct 2007 21:41:35 -0000 Received: (qmail 78308 invoked by uid 500); 17 Oct 2007 21:41:22 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 78279 invoked by uid 500); 17 Oct 2007 21:41:22 -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 78270 invoked by uid 99); 17 Oct 2007 21:41:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Oct 2007 14:41:22 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Oct 2007 21:41:20 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1IiGdP-0002rM-FA for dev@activemq.apache.org; Wed, 17 Oct 2007 14:40:59 -0700 Message-ID: <13263508.post@talk.nabble.com> Date: Wed, 17 Oct 2007 14:40:59 -0700 (PDT) From: Nicky Sandhu To: dev@activemq.apache.org Subject: Deadlocks again :( MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: karajdaar@gmail.com X-Virus-Checked: Checked by ClamAV on apache.org Hi folks, I got hit by another deadlock condition. Thats two different ones on two consecutive days :( In ActiveMQ I see a lot of blocks of code using synchronized access, nothing wrong with that but this increases the potential for deadlocks as evidenced by the last two problems I have hit within the span of a couple of days (https://issues.apache.org/activemq/browse/AMQ-1467, https://issues.apache.org/activemq/browse/AMQ-1468) This may be just my luck but I think it points to concurrency 101 lessons (http://undergraduate.csse.uwa.edu.au/units/CITS3213/lectures2/lect4.pdf) some which are a.) Lock on the appropriate object 2.) don't hold locks for longer than absolutely necessary 3.) avoid nested locks like the plague. 4.) Establish locking order for nested locks etc. Thoughts? Nicky BTW. JConsole has a cool detect deadlock feature in jdk6 which makes this exercise quick (once you stumble across the deadlock that is >:)) + this article (http://www.javaspecialists.eu/archive/Issue130.html) has code that you can run periodically to dump them when they happen... something to be included in perhaps a debug version to help root all these out ? -- View this message in context: http://www.nabble.com/Deadlocks-again-%3A%28-tf4643498s2354.html#a13263508 Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.