Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 25260 invoked from network); 18 Oct 2007 14:48:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Oct 2007 14:48:00 -0000 Received: (qmail 2039 invoked by uid 500); 18 Oct 2007 14:47:47 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 1878 invoked by uid 500); 18 Oct 2007 14:47:47 -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 1869 invoked by uid 99); 18 Oct 2007 14:47:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Oct 2007 07:47:47 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rajdavies@gmail.com designates 66.249.92.175 as permitted sender) Received: from [66.249.92.175] (HELO ug-out-1314.google.com) (66.249.92.175) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Oct 2007 14:47:48 +0000 Received: by ug-out-1314.google.com with SMTP id k3so450436ugf for ; Thu, 18 Oct 2007 07:47:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:in-reply-to:references:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer; bh=j3Uhos+aWssX7VsS9hYbJ4Ih75/TQ6e2wWMVb89XU1I=; b=kP+zZwns++k0aKECYtofSvhj+u60jz9m/9KhT6x9z3XbdEuGEXgHomLjwHcSLpcEvlss6ls+y54o8CLcS5N/5fflzQlfsJl4ohL85cb5witFfrzOiOLOIG+otqHerDmKe5VoFMtexnizi6iU8g098r2UQuQRXnKGrIY+fu8jqBY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:in-reply-to:references:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer; b=pgE7VjdoXplwAXeiV1B2RiJcLfiWsqM1Yp28IgGf+VJeel+eHTSntqfSX2i08Vo+cbklKda5wRl7R2O8I3pDOkazmIne/yp+QwAObrVZpw0GDlqqjxRCwdeyi9ZcT9CJtU5e0X2Cwjx0LEMcr4iU3KEC6KMpvYz/B2cmxOiJuEs= Received: by 10.67.90.4 with SMTP id s4mr1910587ugl.1192718846121; Thu, 18 Oct 2007 07:47:26 -0700 (PDT) Received: from ?192.168.1.67? ( [86.130.75.52]) by mx.google.com with ESMTPS id u6sm6168632uge.2007.10.18.07.47.24 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 18 Oct 2007 07:47:25 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <13275334.post@talk.nabble.com> References: <13263508.post@talk.nabble.com> <1A21F3CF-E9A4-41E1-8939-4C71A193F832@gmail.com> <13275334.post@talk.nabble.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Rob Davies Subject: Re: Deadlocks again :( Date: Thu, 18 Oct 2007 15:47:19 +0100 To: dev@activemq.apache.org X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org Thanks Nicky - really appreciate the input and help!! Will look at adding the dead lock detection code cheers, Rob http://rajdavies.blogspot.com/ On Oct 18, 2007, at 3:07 PM, Nicky Sandhu wrote: > > Hi Rob, > It was not my intention to question your skill, rather it was to > point that > synchronizations lead to deadlocks (potentially) and they are too > difficult > to predict and code review. So I was proposing adding a deadlock > detector > like the one referenced below to optional activemq code. > I see a lot of threads on hung producer/consumer/broker issues and > if such > a deadlock detector could be run either on demand or periodically > it would > help the team in pinpointing deadlock issues. Ofcourse not all hung > issues > would be deadlocks but this can't hurt. > > Very gently, > Nicky > > rajdavies wrote: >> >> Thanks Nicky! >> >> will apply patches asap - we're usually pretty good at avoiding >> deadlocks :( >> >> >> cheers, >> >> Rob >> >> http://rajdavies.blogspot.com/ >> >> >> >> On Oct 17, 2007, at 10:40 PM, Nicky Sandhu wrote: >> >>> >>> 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. >>> >> >> >> > > -- > View this message in context: http://www.nabble.com/Deadlocks-again- > %3A%28-tf4643498s2354.html#a13275334 > Sent from the ActiveMQ - Dev mailing list archive at Nabble.com. >