Github user mridulm commented on a diff in the pull request: https://github.com/apache/spark/pull/1609#discussion_r15449433 --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala --- @@ -947,6 +958,34 @@ private[spark] object Utils extends Logging { } false } + /* + @volatile private var shutdownStarted = false + private[spark] def setShutdownStarted() { + shutdownStarted = true + } + + def inShutdown(): Boolean = { + if (shutdownStarted) return true + doShutdownCheck() + shutdownStarted + } + + private[spark] def doShutdownCheck() { + var shutdown = false + try { + val hook = new Thread { + override def run() {} + } + Runtime.getRuntime.addShutdownHook(hook) + Runtime.getRuntime.removeShutdownHook(hook) + } catch { + case ise: IllegalStateException => + shutdown = true + } finally { + shutdownStarted = shutdown + } + } + */ --- End diff -- This (and related commented inShutdown references) has been left around in case someone else can suggest an improvement ! The issue is, this works fine in 'normal' use : but while running spark tests in local mode, it fails.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---