GitHub user JoshRosen opened a pull request:
https://github.com/apache/spark/pull/5174
[SPARK-6209] Clean up connections in ExecutorClassLoader after failing to
load classes (branch-1.2)
ExecutorClassLoader does not ensure proper cleanup of network connections
that it opens. If it fails to load a class, it may leak partially-consumed
InputStreams that are connected to the REPL's HTTP class server, causing that
server to exhaust its thread pool, which can cause the entire job to hang. See
[SPARK-6209](https://issues.apache.org/jira/browse/SPARK-6209) for more
details, including a bug reproduction.
This patch fixes this issue by ensuring proper cleanup of these resources.
It also adds logging for unexpected error cases.
(See #4944 for the corresponding PR for 1.3/1.4).
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/JoshRosen/spark
executorclassloaderleak-branch-1.2
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/5174.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #5174
----
commit 16e38fea5e8af9d3040e12f74f0e64439599c1d9
Author: Josh Rosen <[email protected]>
Date: 2015-03-24T21:38:20Z
[SPARK-6209] Clean up connections in ExecutorClassLoader after failing to
load classes (master branch PR)
ExecutorClassLoader does not ensure proper cleanup of network connections
that it opens. If it fails to load a class, it may leak partially-consumed
InputStreams that are connected to the REPL's HTTP class server, causing that
server to exhaust its thread pool, which can cause the entire job to hang. See
[SPARK-6209](https://issues.apache.org/jira/browse/SPARK-6209) for more
details, including a bug reproduction.
This patch fixes this issue by ensuring proper cleanup of these resources.
It also adds logging for unexpected error cases.
This PR is an extended version of #4935 and adds a regression test.
Author: Josh Rosen <[email protected]>
Closes #4944 from JoshRosen/executorclassloader-leak-master-branch and
squashes the following commits:
e0e3c25 [Josh Rosen] Wrap try block around getReponseCode; re-enable
keep-alive by closing error stream
961c284 [Josh Rosen] Roll back changes that were added to get the
regression test to fail
7ee2261 [Josh Rosen] Add a failing regression test
e2d70a3 [Josh Rosen] Properly clean up after errors in ExecutorClassLoader
(cherry picked from commit 7215aa745590a3eec9c1ff35d28194235a550db7)
Signed-off-by: Andrew Or <[email protected]>
Conflicts:
repl/pom.xml
repl/src/main/scala/org/apache/spark/repl/ExecutorClassLoader.scala
----
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]