Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6C85BDBF8 for ; Tue, 8 Jan 2013 23:42:13 +0000 (UTC) Received: (qmail 69326 invoked by uid 500); 8 Jan 2013 23:42:13 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 69291 invoked by uid 500); 8 Jan 2013 23:42:13 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 69150 invoked by uid 99); 8 Jan 2013 23:42:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jan 2013 23:42:13 +0000 Date: Tue, 8 Jan 2013 23:42:12 +0000 (UTC) From: "Elliott Clark (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-7515) Store.loadStoreFiles should close opened files if there's an exception 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/HBASE-7515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13547419#comment-13547419 ] Elliott Clark commented on HBASE-7515: -------------------------------------- How can the callable ever return something when it's thrown an exception? Try the example below: {code} package org.apache.hadoop.hbase.regionserver; import org.junit.Test; import java.util.ArrayList; import java.util.List; import java.util.concurrent.Callable; import java.util.concurrent.CompletionService; import java.util.concurrent.ExecutorCompletionService; import java.util.concurrent.Executors; import java.util.concurrent.Future; public class TestFailCreate { @Test public void testFailCallable() throws Exception { CompletionService completionService = new ExecutorCompletionService(Executors.newCachedThreadPool()); List> futureList = new ArrayList>(); for (int i = 0; i < 10; i ++ ) { Future f = completionService.submit(new Callable() { @Override public String call() throws Exception { String test = "STOREFILE CLOSED"; Thread.sleep(100); test = "STORE FILE START OPEN"; if (true == true) { test = "STOREFILE HALF OPEN"; //This is simulating opening the store file. If somewhere in opening up the store // file some exception is thrown. The storefile is left in a half // open state and there is no reference to it. throw new Exception("TEST EXCEPTION"); // test = "STORE FILE FULLY OPEN"; // This line is never reached. } System.out.println("GOT TO THE RETURN LINE"); return test; } }); futureList.add(f); } for (Future f: futureList) { try { String s = f.get(); System.out.println("Got " + s); } catch (Exception e) { System.out.println("Caught error"); } } } } {code} Notice how "GOT TO THE RETURN LINE" is never printed out. > Store.loadStoreFiles should close opened files if there's an exception > ---------------------------------------------------------------------- > > Key: HBASE-7515 > URL: https://issues.apache.org/jira/browse/HBASE-7515 > Project: HBase > Issue Type: Bug > Affects Versions: 0.94.3 > Reporter: Jean-Daniel Cryans > Assignee: Ted Yu > Fix For: 0.96.0, 0.94.5 > > Attachments: 7515.txt, 7515-v2.txt, 7515-v3.txt > > > Related to HBASE-7513. If a RS is able to open a few store files in {{Store.loadStoreFiles}} but one of them fails like in 7513, the opened files won't be closed and file descriptors will remain in a CLOSED_WAIT state. > The situation we encountered is that over the weekend one region was bounced between >100 region servers and eventually they all started dying on "Too many open files". -- 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