From hdfs-issues-return-230086-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Tue Aug 21 05:12:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 9BC42180679 for ; Tue, 21 Aug 2018 05:12:04 +0200 (CEST) Received: (qmail 63604 invoked by uid 500); 21 Aug 2018 03:12:03 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 63532 invoked by uid 99); 21 Aug 2018 03:12:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Aug 2018 03:12:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id EDBE8C1D20 for ; Tue, 21 Aug 2018 03:12:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 3TbxYMh22qJ0 for ; Tue, 21 Aug 2018 03:12:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id D9AD05F42E for ; Tue, 21 Aug 2018 03:12:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 090DBE0E1D for ; Tue, 21 Aug 2018 03:12:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 65CC3246AB for ; Tue, 21 Aug 2018 03:12:00 +0000 (UTC) Date: Tue, 21 Aug 2018 03:12:00 +0000 (UTC) From: "Yiqun Lin (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-13834) RBF: Connection creator thread should catch Throwable 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/HDFS-13834?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16586859#comment-16586859 ] Yiqun Lin commented on HDFS-13834: ---------------------------------- [~crh], I'm okay for this change. Two comments: * Can we reset flag running to false as this is an unexpected error like we catch for InterruptedException? * Would you mind adding a unit test for cover this case in? > RBF: Connection creator thread should catch Throwable > ----------------------------------------------------- > > Key: HDFS-13834 > URL: https://issues.apache.org/jira/browse/HDFS-13834 > Project: Hadoop HDFS > Issue Type: Sub-task > Reporter: CR Hota > Assignee: CR Hota > Priority: Critical > Attachments: HDFS-13834.0.patch, HDFS-13834.1.patch > > > Connection creator thread is a single thread thats responsible for creating all downstream namenode connections. > This is very critical thread and hence should not die understand exception/error scenarios. > We saw this behavior in production systems where the thread died leaving the router process in bad state. > The thread should also catch a generic error/exception. > {code} > @Override > public void run() { > while (this.running) { > try { > ConnectionPool pool = this.queue.take(); > try { > int total = pool.getNumConnections(); > int active = pool.getNumActiveConnections(); > if (pool.getNumConnections() < pool.getMaxSize() && > active >= MIN_ACTIVE_RATIO * total) { > ConnectionContext conn = pool.newConnection(); > pool.addConnection(conn); > } else { > LOG.debug("Cannot add more than {} connections to {}", > pool.getMaxSize(), pool); > } > } catch (IOException e) { > LOG.error("Cannot create a new connection", e); > } > } catch (InterruptedException e) { > LOG.error("The connection creator was interrupted"); > this.running = false; > } > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org