Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 92D3510A07 for ; Wed, 4 Sep 2013 19:11:00 +0000 (UTC) Received: (qmail 27561 invoked by uid 500); 4 Sep 2013 19:10:56 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 27499 invoked by uid 500); 4 Sep 2013 19:10:56 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 27346 invoked by uid 99); 4 Sep 2013 19:10:54 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Sep 2013 19:10:54 +0000 Date: Wed, 4 Sep 2013 19:10:54 +0000 (UTC) From: "Jing Zhao (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-9932) Name node crashes due to improper synchronization in RetryCache 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/HADOOP-9932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13758206#comment-13758206 ] Jing Zhao commented on HADOOP-9932: ----------------------------------- Also, in RetryCache#addCacheEntry and RetryCache#addCacheEntryWithPayload, instead of calling "newEntry.completed(true)" which acquires the entry monitor and makes a notifyAll call, maybe we can directly set the state of the entry to "SUCCESS" in a new setComplete/constructor method. I.e., {code} public void addCacheEntry(byte[] clientId, int callId) { CacheEntry newEntry = new CacheEntry(clientId, callId, System.nanoTime() - + expirationTime); - newEntry.completed(true); - set.put(newEntry); + + expirationTime, true); + synchronized (this) { + set.put(newEntry); + } } {code} > Name node crashes due to improper synchronization in RetryCache > --------------------------------------------------------------- > > Key: HADOOP-9932 > URL: https://issues.apache.org/jira/browse/HADOOP-9932 > Project: Hadoop Common > Issue Type: Bug > Reporter: Kihwal Lee > Assignee: Kihwal Lee > Priority: Blocker > Attachments: HADOOP-9932.patch, HADOOP-9932.patch > > > In LightWeightCache#evictExpiredEntries(), the precondition check can fail. [~patwhitey2007] ran a HA failover test and it occurred while the SBN was catching up with edits during a transition to active. This caused NN to terminate. > Here is my theory: If an RPC handler calls waitForCompletion() and it happens to remove the head of the queue in get(), it will race with evictExpiredEntries() frrom put(). -- 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