Skip to content

Conversation

@vanzin
Copy link
Contributor

@vanzin vanzin commented Apr 24, 2015

Set up a shutdown hook to try to stop the Spark context in
case the user forgets to do it. The main effect is that any
open logs files are flushed and closed, which is particularly
interesting for event logs.

Set up a shutdown hook to try to stop the Spark context in
case the user forgets to do it. The main effect is that any
open logs files are flushed and closed, which is particularly
interesting for event logs.
@vanzin
Copy link
Contributor Author

vanzin commented Apr 24, 2015

Note that as is this will cause an exception if the hook actually runs; #5672 has a change that fixes that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the grounds that the YARN AM already tries to do this, I think this is probably a good change to implement for all modes. I think it's all too common that user programs exit without calling stop() and this does affect things like finding logs.

Calling stop() is idempotent right? so the extra hook shouldn't hurt anything even for well-behaved programs.

You have some spurious white-space changes in this PR. Not really worth fixing but might tell your IDE not to change trailing whitespace.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling stop() is idempotent right?

Correct.

You have some spurious white-space changes in this PR.

IIRC that's in the style guide (not adding trailing whitespace) and we're really, really bad at enforcing that.

@SparkQA
Copy link

SparkQA commented Apr 25, 2015

Test build #30948 has finished for PR 5696 at commit 3b554b5.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.
  • This patch adds the following new dependencies:
    • tachyon-0.6.4.jar
    • tachyon-client-0.6.4.jar
  • This patch removes the following dependencies:
    • tachyon-0.5.0.jar
    • tachyon-client-0.5.0.jar

@srowen
Copy link
Member

srowen commented Apr 25, 2015

LGTM. I dislike the proliferation of shutdown hooks but we have a better centralized system for it now, and this one is fairly important. Let me leave it for comments for a couple days though.

@asfgit asfgit closed this in 5d45e1f Apr 27, 2015
@vanzin vanzin deleted the SPARK-3090 branch April 28, 2015 19:09
jeanlyn pushed a commit to jeanlyn/spark that referenced this pull request May 14, 2015
Set up a shutdown hook to try to stop the Spark context in
case the user forgets to do it. The main effect is that any
open logs files are flushed and closed, which is particularly
interesting for event logs.

Author: Marcelo Vanzin <vanzin@cloudera.com>

Closes apache#5696 from vanzin/SPARK-3090 and squashes the following commits:

3b554b5 [Marcelo Vanzin] [SPARK-3090] [core] Stop SparkContext if user forgets to.
nemccarthy pushed a commit to nemccarthy/spark that referenced this pull request Jun 19, 2015
Set up a shutdown hook to try to stop the Spark context in
case the user forgets to do it. The main effect is that any
open logs files are flushed and closed, which is particularly
interesting for event logs.

Author: Marcelo Vanzin <vanzin@cloudera.com>

Closes apache#5696 from vanzin/SPARK-3090 and squashes the following commits:

3b554b5 [Marcelo Vanzin] [SPARK-3090] [core] Stop SparkContext if user forgets to.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants