Return-Path: X-Original-To: apmail-spark-issues-archive@minotaur.apache.org Delivered-To: apmail-spark-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 B33321887A for ; Tue, 24 Nov 2015 07:42:16 +0000 (UTC) Received: (qmail 41671 invoked by uid 500); 24 Nov 2015 07:42:11 -0000 Delivered-To: apmail-spark-issues-archive@spark.apache.org Received: (qmail 41636 invoked by uid 500); 24 Nov 2015 07:42:11 -0000 Mailing-List: contact issues-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@spark.apache.org Received: (qmail 41606 invoked by uid 99); 24 Nov 2015 07:42:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Nov 2015 07:42:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 06FEE2C044E for ; Tue, 24 Nov 2015 07:42:11 +0000 (UTC) Date: Tue, 24 Nov 2015 07:42:10 +0000 (UTC) From: "Josh Rosen (JIRA)" To: issues@spark.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (SPARK-11943) Rapidly starting and stopping SparkContexts in local-cluster mode may cause JVM to exit MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Josh Rosen created SPARK-11943: ---------------------------------- Summary: Rapidly starting and stopping SparkContexts in local-cluster mode may cause JVM to exit Key: SPARK-11943 URL: https://issues.apache.org/jira/browse/SPARK-11943 Project: Spark Issue Type: Bug Components: Tests Reporter: Josh Rosen Priority: Minor While trying to performance-profile the creation of SparkContexts in {{local-cluster}} mode, I ran into a weird bug which could cause {{System.exit()}} to be called. In {{local-cluster}} mode, the Master and Worker processes are run in the driver JVM. Inside of Master and Worker, there are error-handling paths which call {{System.exit()}} in certain cases. If you start and stop SparkContexts very quickly in {{local-cluster}} mode, then I think you can hit race conditions which cause the {{System.exit()}} error-handling paths to be hit. Here's a test case which consistently reproduces the problem on my laptop: {code} class LocalClusterLaunchTimeBenchmark extends SparkFunSuite with LocalSparkContext with Logging { test("benchmark local cluster launching and teardown") { for (i <- 1 to 100) { val startTime = System.currentTimeMillis() val conf = new SparkConf() .set("spark.ui.enabled", "false") .set("spark.testing", "true") .set("spark.master.rest.enabled", "false") sc = new SparkContext("local-cluster[2,1,1024]", s"test-$i", conf) log.info("--STOPPING--") sc.stop() log.info("--STOPPED--") val duration = startTime - System.currentTimeMillis() println("Duration" + duration) } } } {code} I'm not sure whether this underlying problem has led to flakiness in Jenkins. One test which would be susceptible to this is DistributedSuite's "local-cluster format" test, which winds up spinning up a bunch of SparkContexts to validate the parsing of {{local-cluster}} patterns: https://github.com/apache/spark/blob/4021a28ac30b65cb61cf1e041253847253a2d89f/core/src/test/scala/org/apache/spark/DistributedSuite.scala#L52. We shouldn't be testing this functionality by creating new contexts, so this test should be refactored anyways, but the Master/Worker System.exit() would explain things if we've ever observed this test to fail. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org For additional commands, e-mail: issues-help@spark.apache.org