Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-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 3013FB950 for ; Wed, 4 Jan 2012 19:00:28 +0000 (UTC) Received: (qmail 84720 invoked by uid 500); 4 Jan 2012 19:00:27 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 84701 invoked by uid 500); 4 Jan 2012 19:00:27 -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 84694 invoked by uid 99); 4 Jan 2012 19:00:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Jan 2012 19:00:27 +0000 X-ASF-Spam-Status: No, hits=-2001.6 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; Wed, 04 Jan 2012 19:00:25 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id CE72D138A8B for ; Wed, 4 Jan 2012 18:59:39 +0000 (UTC) Date: Wed, 4 Jan 2012 18:59:39 +0000 (UTC) From: "Mike Matrigali (Assigned) (JIRA)" To: derby-dev@db.apache.org Message-ID: <92665740.5899.1325703579847.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <200139379.497.1325601639800.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Assigned] (DERBY-5564) Code does different things depending if derby.locks.deadlockTrace=true is set MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-5564?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mike Matrigali reassigned DERBY-5564: ------------------------------------- Assignee: Mike Matrigali > Code does different things depending if derby.locks.deadlockTrace=true is set > ----------------------------------------------------------------------------- > > Key: DERBY-5564 > URL: https://issues.apache.org/jira/browse/DERBY-5564 > Project: Derby > Issue Type: Bug > Components: Network Client, Network Server > Affects Versions: 10.8.2.2 > Environment: Solaris 10 > Glassfish V2.1.1 > Reporter: Brett Bergquist > Assignee: Mike Matrigali > Attachments: DERBY-5564.patch > > > I see a problem in the code handling lock timeout exceptions. In the code in various places there are calls such as: > // 2 kinds of errors here expected here. Either container not > // found or could not obtain lock (LOCK_TIMEOUT or DEADLOCK). > // > // It is possible by the time this post commit work gets scheduled > // that the container has been dropped and that the open container > // call will return null - in this case just return assuming no > // work to be done. > if (se.getMessageId().equals(SQLState.LOCK_TIMEOUT) || > se.getMessageId().equals(SQLState.DEADLOCK)) > Or > // First try to do the work in the nested transaction. Fail if we can't > // get a lock immediately. > if ( nestedTransaction != null ) > { > try { > return updateCurrentValueOnDisk( nestedTransaction, oldValue, newValue, false ); > } > catch (StandardException se) > { > if ( !se.getMessageId().equals( SQLState.LOCK_TIMEOUT ) ) { throw se; } > } > Or > // exception might have occured either container got dropper or lock not granted. > // It is possible by the time this post commit work gets scheduled > // that the container has been dropped and that the open container > // call will return null - in this case just return assuming no > // work to be done. > //If this expcetion is because lock could not be obtained , work is requeued. > if (se.getMessageId().equals(SQLState.LOCK_TIMEOUT) || > se.getMessageId().equals(SQLState.DEADLOCK)) > { > requeue_work = true; > } > The problem that I see is that if the property "derby.locks.deadlockTrace=true" is set, then instead of a SQLState.LOCK_TIMEOUT, the code will see a SQLState.LOCK_TIMEOUT_LOG. Note that this is not being checked for in the above tests and others as well, so now the code behavior is going to change basd on whether the lock tracing is enabled or not. > I think that 99% of the code that is testing for SQLState.LOCK_TIMEOUT should also be checking for SQLState.LOCK_TIMEOUT_LOG as well. I only see one place in DDLConstantAction where it is explicitly mentioned that SQLState.LOCK_TIMEOUT_LOG is not being looked at. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira