Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-6690] spark-sql script ends up throwing Exception when event logging is enabled. #5341

Closed
wants to merge 3 commits into from

Conversation

sarutak
Copy link
Member

@sarutak sarutak commented Apr 3, 2015

When event logging is enabled, spark-sql script ends up throwing Exception like as follows.

15/04/03 13:51:49 INFO handler.ContextHandler: stopped o.e.j.s.ServletContextHandler{/jobs,null}
15/04/03 13:51:49 ERROR scheduler.LiveListenerBus: Listener EventLoggingListener threw an exception
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.spark.scheduler.EventLoggingListener$$anonfun$logEvent$3.apply(EventLoggingListener.scala:144)
    at org.apache.spark.scheduler.EventLoggingListener$$anonfun$logEvent$3.apply(EventLoggingListener.scala:144)
    at scala.Option.foreach(Option.scala:236)
    at org.apache.spark.scheduler.EventLoggingListener.logEvent(EventLoggingListener.scala:144)
    at org.apache.spark.scheduler.EventLoggingListener.onApplicationEnd(EventLoggingListener.scala:188)
    at org.apache.spark.scheduler.SparkListenerBus$class.onPostEvent(SparkListenerBus.scala:54)
    at org.apache.spark.scheduler.LiveListenerBus.onPostEvent(LiveListenerBus.scala:31)
    at org.apache.spark.scheduler.LiveListenerBus.onPostEvent(LiveListenerBus.scala:31)
    at org.apache.spark.util.ListenerBus$class.postToAll(ListenerBus.scala:53)
    at org.apache.spark.util.AsynchronousListenerBus.postToAll(AsynchronousListenerBus.scala:37)
    at org.apache.spark.util.AsynchronousListenerBus$$anon$1$$anonfun$run$1.apply$mcV$sp(AsynchronousListenerBus.scala:79)
    at org.apache.spark.util.Utils$.tryOrStopSparkContext(Utils.scala:1171)
    at org.apache.spark.util.AsynchronousListenerBus$$anon$1.run(AsynchronousListenerBus.scala:63)
Caused by: java.io.IOException: Filesystem closed
    at org.apache.hadoop.hdfs.DFSClient.checkOpen(DFSClient.java:707)
    at org.apache.hadoop.hdfs.DFSOutputStream.flushOrSync(DFSOutputStream.java:1843)
    at org.apache.hadoop.hdfs.DFSOutputStream.hflush(DFSOutputStream.java:1804)
    at org.apache.hadoop.fs.FSDataOutputStream.hflush(FSDataOutputStream.java:127)
    ... 17 more
15/04/03 13:51:49 INFO ui.SparkUI: Stopped Spark web UI at http://sarutak-devel:4040
15/04/03 13:51:49 INFO scheduler.DAGScheduler: Stopping DAGScheduler
Exception in thread "Thread-6" java.io.IOException: Filesystem closed
    at org.apache.hadoop.hdfs.DFSClient.checkOpen(DFSClient.java:707)
    at org.apache.hadoop.hdfs.DFSClient.getFileInfo(DFSClient.java:1760)
    at org.apache.hadoop.hdfs.DistributedFileSystem$17.doCall(DistributedFileSystem.java:1124)
    at org.apache.hadoop.hdfs.DistributedFileSystem$17.doCall(DistributedFileSystem.java:1120)
    at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
    at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:1120)
    at org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:1398)
    at org.apache.spark.scheduler.EventLoggingListener.stop(EventLoggingListener.scala:209)
    at org.apache.spark.SparkContext$$anonfun$stop$3.apply(SparkContext.scala:1408)
    at org.apache.spark.SparkContext$$anonfun$stop$3.apply(SparkContext.scala:1408)
    at scala.Option.foreach(Option.scala:236)
    at org.apache.spark.SparkContext.stop(SparkContext.scala:1408)
    at org.apache.spark.sql.hive.thriftserver.SparkSQLEnv$.stop(SparkSQLEnv.scala:66)
    at org.apache.spark.sql.hive.thriftserver.SparkSQLCLIDriver$$anon$1.run(SparkSQLCLIDriver.scala:107)

This is because FileSystem#close is called by the shutdown hook registered in SparkSQLCLIDriver.

    Runtime.getRuntime.addShutdownHook(
      new Thread() {
        override def run() {
          SparkSQLEnv.stop()
        }
      }
    )

This issue was resolved by SPARK-3062 but I think, it's brought again by SPARK-2261.

@sarutak sarutak changed the title spark-sql script ends up throwing Exception when event logging is enabled. [SPARK-6690] spark-sql script ends up throwing Exception when event logging is enabled. Apr 3, 2015
@SparkQA
Copy link

SparkQA commented Apr 3, 2015

Test build #29648 has started for PR 5341 at commit d05f4d1.

@SparkQA
Copy link

SparkQA commented Apr 3, 2015

Test build #29648 has finished for PR 5341 at commit d05f4d1.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.
  • This patch does not change any dependencies.

@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/29648/
Test PASSed.

@SparkQA
Copy link

SparkQA commented Apr 10, 2015

Test build #30001 has started for PR 5341 at commit 7870280.

@SparkQA
Copy link

SparkQA commented Apr 10, 2015

Test build #30001 has finished for PR 5341 at commit 7870280.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.
  • This patch does not change any dependencies.

@AmplabJenkins
Copy link

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

@SparkQA
Copy link

SparkQA commented Apr 10, 2015

Test build #30009 has started for PR 5341 at commit 2b479c3.

@SparkQA
Copy link

SparkQA commented Apr 10, 2015

Test build #30009 has finished for PR 5341 at commit 2b479c3.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.
  • This patch does not change any dependencies.

@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/30009/
Test PASSed.

@vanzin
Copy link
Contributor

vanzin commented Apr 10, 2015

I don't think this is the best fix. See discussion in #4771 (which the original author unfortunately closed).

@WangTaoTheTonic
Copy link
Contributor

Hey @sarutak Any updates on this?

@sarutak
Copy link
Member Author

sarutak commented Apr 22, 2015

I think #5560 resolved this issue so I'll close this PR.

@sarutak sarutak closed this Apr 22, 2015
@sarutak sarutak deleted the SPARK-6690 branch May 18, 2015 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants