Return-Path: X-Original-To: apmail-jackrabbit-dev-archive@www.apache.org Delivered-To: apmail-jackrabbit-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 6DABA9700 for ; Wed, 19 Oct 2011 13:54:33 +0000 (UTC) Received: (qmail 39681 invoked by uid 500); 19 Oct 2011 13:54:33 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 39637 invoked by uid 500); 19 Oct 2011 13:54:33 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 39630 invoked by uid 99); 19 Oct 2011 13:54:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Oct 2011 13:54:33 +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; Wed, 19 Oct 2011 13:54:30 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 9D0FF31168A for ; Wed, 19 Oct 2011 13:54:10 +0000 (UTC) Date: Wed, 19 Oct 2011 13:54:10 +0000 (UTC) From: "Julian Reschke (Updated) (JIRA)" To: dev@jackrabbit.apache.org Message-ID: <41432596.10553.1319032450644.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <583148865.15579.1318268429747.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (JCR-3105) NPE when versioning operations are concurrent MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/JCR-3105?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Julian Reschke updated JCR-3105: -------------------------------- Component/s: versioning Fix Version/s: 2.2.10 2.2: r1186217 > NPE when versioning operations are concurrent > --------------------------------------------- > > Key: JCR-3105 > URL: https://issues.apache.org/jira/browse/JCR-3105 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: jackrabbit-core, versioning > Reporter: Julian Reschke > Assignee: Julian Reschke > Fix For: 2.2.10, 2.3.1 > > Attachments: JCR-3105.patch > > > InternalVersionManagerBase.getParentNode occasionally throws an NPE: > protected static NodeStateEx getParentNode(NodeStateEx parent, String uuid, Name interNT) > throws RepositoryException { > NodeStateEx n = parent; > for (int i = 0; i < 3; i++) { > Name name = getName(uuid.substring(i * 2, i * 2 + 2)); > if (n.hasNode(name)) { > n = n.getNode(name, 1); > assert n != null; > } else if (interNT != null) { > n.addNode(name, interNT, null, false); > n.store(); > n = n.getNode(name, 1); > assert n != null; > } else { > return null; > } > } > return n; > } > Apparently getNode occasionally returns null due to race conditions. > Changing the code to what's below appears to fix it: > protected static NodeStateEx getParentNode(NodeStateEx parent, String uuid, Name interNT) > throws RepositoryException { > NodeStateEx n = parent; > for (int i = 0; i < 3; i++) { > Name name = getName(uuid.substring(i * 2, i * 2 + 2)); > NodeStateEx n2 = n.getNode(name, 1); > if (n2 != null) { > n = n2; > } else if (interNT != null) { > n2 = n.addNode(name, interNT, null, false); > n.store(); > n = n2; > } else { > return null; > } > } > return n; > } > (but likely moves the race condition somewhere else) -- 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