Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 86F08200C17 for ; Fri, 10 Feb 2017 23:23:18 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 8580C160B5C; Fri, 10 Feb 2017 22:23:18 +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 008CA160B4E for ; Fri, 10 Feb 2017 23:23:17 +0100 (CET) Received: (qmail 82663 invoked by uid 500); 10 Feb 2017 22:23:17 -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 82652 invoked by uid 99); 10 Feb 2017 22:23:16 -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, 10 Feb 2017 22:23:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CF66FDFBE6; Fri, 10 Feb 2017 22:23:16 +0000 (UTC) From: zsxwing To: reviews@spark.apache.org Reply-To: reviews@spark.apache.org References: In-Reply-To: Subject: [GitHub] spark pull request #16880: [SPARK-19542][SS]Delete the temp checkpoint if a ... Content-Type: text/plain Message-Id: <20170210222316.CF66FDFBE6@git1-us-west.apache.org> Date: Fri, 10 Feb 2017 22:23:16 +0000 (UTC) archived-at: Fri, 10 Feb 2017 22:23:18 -0000 Github user zsxwing commented on a diff in the pull request: https://github.com/apache/spark/pull/16880#discussion_r100636660 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/StreamExecution.scala --- @@ -323,6 +329,20 @@ class StreamExecution( sparkSession.streams.notifyQueryTermination(StreamExecution.this) postEvent( new QueryTerminatedEvent(id, runId, exception.map(_.cause).map(Utils.exceptionString))) + + // Delete the temp checkpoint only when the query didn't fail + if (deleteCheckpointOnStop && exception.isEmpty) { + val checkpointPath = new Path(checkpointRoot) + try { + val fs = checkpointPath.getFileSystem(sparkSession.sessionState.newHadoopConf()) + fs.delete(checkpointPath, true) + } catch { + case e: IOException => --- End diff -- Good point. I changed it to `NonFatal`. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org For additional commands, e-mail: reviews-help@spark.apache.org