Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/4412#discussion_r24289455
--- Diff: core/src/main/scala/org/apache/spark/SparkEnv.scala ---
@@ -93,6 +93,19 @@ class SparkEnv (
// actorSystem.awaitTermination()
// Note that blockTransferService is stopped by BlockManager since it
is started by it.
+
+ // If we only stop sc, but the driver process still run as a services
then we need to delete
+ // the tmp dir, if not, it will create too many tmp dirs.
+ // We only need to delete the tmp dir create by driver, because
sparkFilesDir is point to the
+ // current working dir in executor which we do not need to delete.
+ if (SparkContext.DRIVER_IDENTIFIER == executorId) {
--- End diff --
I see that this condition should indeed match the logic which controls
whether this directory is a temp dir, but since the consequence of getting this
wrong is pretty significant, I wonder if we should be more conservative. For
example, save off the `isDriver` flag and use it in both places to be sure that
these are exactly in sync? or maintain a separate reference to the temp dir
that was created, which is `None` if no temp dir was created, and so you can be
sure you can delete it if it's not `None`?
---
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]