Skip to content

Conversation

@MattWhelan
Copy link

After a call to stop, the shutdown hook is redundant, and causes a
memory leak.

After a call to stop, the shutdown hook is redundant, and causes a
memory leak.
@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@srowen
Copy link
Member

srowen commented Feb 16, 2015

LGTM

@srowen
Copy link
Member

srowen commented Feb 16, 2015

ok to test

@SparkQA
Copy link

SparkQA commented Feb 16, 2015

Test build #27565 has started for PR 4627 at commit d5f5c7f.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Feb 16, 2015

Test build #27565 has finished for PR 4627 at commit d5f5c7f.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • case class ParquetRelation2(

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/27565/
Test PASSed.

asfgit pushed a commit that referenced this pull request Feb 16, 2015
After a call to stop, the shutdown hook is redundant, and causes a
memory leak.

Author: Matt Whelan <mwhelan@perka.com>

Closes #4627 from MattWhelan/SPARK-5841 and squashes the following commits:

d5f5c7f [Matt Whelan] SPARK-5841: remove DiskBlockManager shutdown hook on stop

(cherry picked from commit bb05982)
Signed-off-by: Sean Owen <sowen@cloudera.com>
@asfgit asfgit closed this in bb05982 Feb 16, 2015
@JoshRosen
Copy link
Contributor

It looks like removeShutdownHook here can get called during shutdown, which leads to some exceptions that might prevent other cleanup from taking place:

Exception in thread "delete Spark local dirs" java.lang.IllegalStateException: Shutdown in progress
        at java.lang.ApplicationShutdownHooks.remove(ApplicationShutdownHooks.java:82)
        at java.lang.Runtime.removeShutdownHook(Runtime.java:239)
        at org.apache.spark.storage.DiskBlockManager.stop(DiskBlockManager.scala:151)
        at org.apache.spark.storage.DiskBlockManager$$anon$1$$anonfun$run$1.apply$mcV$sp(DiskBlockManager.scala:141)
        at org.apache.spark.storage.DiskBlockManager$$anon$1$$anonfun$run$1.apply(DiskBlockManager.scala:139)
        at org.apache.spark.storage.DiskBlockManager$$anon$1$$anonfun$run$1.apply(DiskBlockManager.scala:139)
        at org.apache.spark.util.Utils$.logUncaughtExceptions(Utils.scala:1613)
        at org.apache.spark.storage.DiskBlockManager$$anon$1.run(DiskBlockManager.scala:139)
Exception in thread "delete Spark local dirs" java.lang.IllegalStateException: Shutdown in progress
        at java.lang.ApplicationShutdownHooks.remove(ApplicationShutdownHooks.java:82)
        at java.lang.Runtime.removeShutdownHook(Runtime.java:239)
        at org.apache.spark.storage.DiskBlockManager.stop(DiskBlockManager.scala:151)
        at org.apache.spark.storage.DiskBlockManager$$anon$1$$anonfun$run$1.apply$mcV$sp(DiskBlockManager.scala:141)
        at org.apache.spark.storage.DiskBlockManager$$anon$1$$anonfun$run$1.apply(DiskBlockManager.scala:139)
        at org.apache.spark.storage.DiskBlockManager$$anon$1$$anonfun$run$1.apply(DiskBlockManager.scala:139)
        at org.apache.spark.util.Utils$.logUncaughtExceptions(Utils.scala:1613)
        at org.apache.spark.storage.DiskBlockManager$$anon$1.run(DiskBlockManager.scala:139)

@srowen @MattWhelan Can you fix this or file a JIRA?

@srowen
Copy link
Member

srowen commented Feb 17, 2015

Ah, how did you trigger that BTW? Yes I will help get it patched. I imagine the stop logic must be factored into a method called both by the hook and by stop, which can still unregister the hook first.

@JoshRosen
Copy link
Contributor

@MattWhelan
Copy link
Author

Kinda weird that it would pass sometimes and fail others. I'll submit a fix tomorrow.

@pwendell
Copy link
Contributor

@JoshRosen should we revert this in 1.3 then? I might create a release candidate soon to kick off community testing.

@JoshRosen
Copy link
Contributor

@pwendell I suppose we could revert. A bandaid patch would be to just wrap this in a try block and ignore exceptions thrown when removing the hook (see also: Utils.inShutdown()). What do you think about just hotfixing in a Try?

@srowen
Copy link
Member

srowen commented Feb 17, 2015

@pwendell @JoshRosen @MattWhelan Let me propose a 'real' fix I think. This should be possible to make correct with a few more lines of code.

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.

6 participants