Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 71907 invoked from network); 10 Mar 2006 15:35:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 Mar 2006 15:35:16 -0000 Received: (qmail 45616 invoked by uid 500); 10 Mar 2006 15:35:06 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 45534 invoked by uid 500); 10 Mar 2006 15:35:06 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 45516 invoked by uid 99); 10 Mar 2006 15:35:06 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Mar 2006 07:35:06 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Mar 2006 07:35:05 -0800 Received: from ajax (localhost.localdomain [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 574E4D49FB for ; Fri, 10 Mar 2006 15:34:44 +0000 (GMT) Message-ID: <33604741.1142004884354.JavaMail.jira@ajax> Date: Fri, 10 Mar 2006 15:34:44 +0000 (GMT) From: "Bryan Pendleton (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Assigned: (DERBY-666) Enhance derby.locks.deadlockTrace to print stack traces for all threads involved in a deadlock In-Reply-To: <1371781784.1130791675575.JavaMail.jira@ajax.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-666?page=all ] Bryan Pendleton reassigned DERBY-666: ------------------------------------- Assign To: (was: Bryan Pendleton) I'm not actively working on this. There were two problems with the solution I was pursuing: 1) It required JDK 1.5 features 2) It didn't work in the Network Server case, only in the embedded case Mike suggested some other implementations that might have resolved these problems, but I'm not currently able to spend enough time to pursue these solutions, so I'm unassigning myself from the issue in the hopes that somebody else might be interested. If, after a while, nobody else appears to be interested, I'll close this as Wont-Fix. > Enhance derby.locks.deadlockTrace to print stack traces for all threads involved in a deadlock > ---------------------------------------------------------------------------------------------- > > Key: DERBY-666 > URL: http://issues.apache.org/jira/browse/DERBY-666 > Project: Derby > Type: Improvement > Components: Store > Versions: 10.1.1.0 > Reporter: Bryan Pendleton > Priority: Minor > Attachments: repro.java > > I was reading http://www.linux-mag.com/content/view/2134/ (good article, btw!), and it says: > > The next two properties are needed to diagnose concurrency (locking and deadlock) problems. > > > > *derby.locks.monitor=true logs all deadlocks that occur in the system. > > *derby.locks.deadlockTrace=true log a stack trace of all threads involved in lock-related rollbacks. > It seems, that, in my environment, the deadlockTrace property does not log a stack trace of *all* threads involved in the deadlock. > Instead, it only logs a stack trace of the *victim* thread involved in the deadlock. > I think it would be very useful if the derby.locks.deadlockTrace setting could in fact log a stack trace of all involved threads. > In a posting to derby-dev, Mike Matrigali noted that an earlier implementation of a similar feature had to be removed because it was too expensive in both time and space, but he suggested that there might be several possible ways to implement this in an acceptably efficient manner: > > A long time ago there use to be room in each lock to point at a > > stack trace for each lock, but that was removed to optimize the size > > of the lock data structure which can have many objects outstanding. > > And creating and storing the stack for every lock was incredibly slow > > and just was not very useful for any very active application. I think > > I was the only one who ever used it. > > > > The plan was sometime to add a per user data structure which could be > > filled in when it was about to wait on a lock, which would give most of what is interesting in a deadlock. > > > > The current deadlockTrace is meant to dump the lock table out to derby.log when a deadlock is encountered. > > > > I agree getting a dump of all stack traces would be very useful, and > > with the later jvm debug interfaces may now be possible - in earlier > > JVM's there weren't any java interfaces to do so. Does anyone have > > the code to donate to dump all thread stacks to a buffer? > Mike also suggested a manual technique as a workaround; it would be useful to put this into the documentation somewhere, perhaps on the page which documents derby.locks.deadlockTrace? Here's Mike's suggestion: > > What I do if I can reproduce easily is set try to catch the wait by > > hand and then depending on the environment either send the magic > > signal or hit ctrl-break in the server window which will send the JVM > > specific thread dumps to derby.log. > The magic signal, btw, is 'kill -QUIT', at least with Sun JVMs in my experience. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira