From reviews-return-605646-archive-asf-public=cust-asf.ponee.io@spark.apache.org Fri Jan 19 19:16:44 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id B5EFC180607 for ; Fri, 19 Jan 2018 19:16:44 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A5ABD160C49; Fri, 19 Jan 2018 18:16:44 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1E916160C1B for ; Fri, 19 Jan 2018 19:16:43 +0100 (CET) Received: (qmail 60227 invoked by uid 500); 19 Jan 2018 18:16:43 -0000 Mailing-List: contact reviews-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list reviews@spark.apache.org Received: (qmail 60205 invoked by uid 99); 19 Jan 2018 18:16:43 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jan 2018 18:16:43 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E424BE0A0D; Fri, 19 Jan 2018 18:16:42 +0000 (UTC) From: vanzin To: reviews@spark.apache.org Reply-To: reviews@spark.apache.org References: In-Reply-To: Subject: [GitHub] spark pull request #20297: [SPARK-23020][CORE] Fix races in launcher code, t... Content-Type: text/plain Message-Id: <20180119181642.E424BE0A0D@git1-us-west.apache.org> Date: Fri, 19 Jan 2018 18:16:42 +0000 (UTC) Github user vanzin commented on a diff in the pull request: https://github.com/apache/spark/pull/20297#discussion_r162694343 --- Diff: launcher/src/main/java/org/apache/spark/launcher/LauncherServer.java --- @@ -331,23 +358,27 @@ protected void handle(Message msg) throws IOException { timeout.cancel(); } close(); + if (handle != null) { + handle.dispose(); + } } finally { timeoutTimer.purge(); } } @Override public void close() throws IOException { + if (!isOpen()) { + return; + } + synchronized (clients) { clients.remove(this); } - super.close(); - if (handle != null) { - if (!handle.getState().isFinal()) { - LOG.log(Level.WARNING, "Lost connection to spark application."); - handle.setState(SparkAppHandle.State.LOST); - } - handle.disconnect(); --- End diff -- See https://github.com/apache/spark/pull/20297#pullrequestreview-89568079 --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org For additional commands, e-mail: reviews-help@spark.apache.org