GitHub user JoshRosen opened a pull request:
https://github.com/apache/spark/pull/14510
[SPARK-16925] Master should call schedule() after all executor exits, not
only failures
## What changes were proposed in this pull request?
This patch fixes a bug in Spark's standalone Master which could cause
applications to hang if tasks cause executors to exit with zero exit codes.
As an example of the bug, run
```
sc.parallelize(1 to 1, 1).foreachPartition { _ => System.exit(0) }
```
on a standalone cluster which has a single Spark application. This will
cause all executors to die but those executors won't be replaced unless another
Spark application or worker joins or leaves the cluster. This behavior is
caused by a bug in how the Master handles the `ExecutorStateChanged` event: the
current implementation calls `schedule()` only if the executor exited with a
non-zero exit code, so a task which causes a JVM to unexpectedly exit "cleanly"
will skip the `schedule()` call.
This patch addresses this by modifying the `ExecutorStateChanged` to always
unconditionally call `schedule()`. This should be safe because it should always
be safe to call `schedule()`; adding extra `schedule()` calls can only affect
performance and should not introduce correctness bugs.
## How was this patch tested?
I added a regression test in `DistributedSuite`.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/JoshRosen/spark SPARK-16925
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/14510.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 #14510
----
----
---
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]