Return-Path: X-Original-To: apmail-giraph-dev-archive@www.apache.org Delivered-To: apmail-giraph-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 59B049DD4 for ; Fri, 8 Mar 2013 07:12:17 +0000 (UTC) Received: (qmail 41643 invoked by uid 500); 8 Mar 2013 07:12:16 -0000 Delivered-To: apmail-giraph-dev-archive@giraph.apache.org Received: (qmail 41160 invoked by uid 500); 8 Mar 2013 07:12:15 -0000 Mailing-List: contact dev-help@giraph.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@giraph.apache.org Delivered-To: mailing list dev@giraph.apache.org Received: (qmail 41120 invoked by uid 500); 8 Mar 2013 07:12:14 -0000 Delivered-To: apmail-incubator-giraph-dev@incubator.apache.org Received: (qmail 41095 invoked by uid 99); 8 Mar 2013 07:12:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Mar 2013 07:12:13 +0000 Date: Fri, 8 Mar 2013 07:12:13 +0000 (UTC) From: "Alessandro Presta (JIRA)" To: giraph-dev@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (GIRAPH-556) Race condition in EdgeStore 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/GIRAPH-556?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alessandro Presta updated GIRAPH-556: ------------------------------------- Attachment: GIRAPH-556.patch Fixes the bug by always initializing a newly-created VertexEdges before inserting it. At the same time, I also remove some leftover checks for null pointer in VertexEdges#initialize() implementations: we never (and should never) call initialize with a null Iterable (what I originally thought was the cause of this bug). > Race condition in EdgeStore > --------------------------- > > Key: GIRAPH-556 > URL: https://issues.apache.org/jira/browse/GIRAPH-556 > Project: Giraph > Issue Type: Bug > Reporter: Alessandro Presta > Priority: Critical > Attachments: GIRAPH-556.patch > > > In EdgeStore#addPartitionEdges(), when there is no VertexEdges data structure for a vertex, we try to insert a newly-created one. If the insertion is successful, we initialize it and later insert an edge in the synchronized block. > It can happen that, between creation and initialization, another thread acquires the lock and tries to add an edge, leading to a NullPointerException for many implementations of VertexEdges. > The fix is to create and initialize the structure before we try to insert it. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira