dongjoon-hyun opened a new pull request, #45313:
URL: https://github.com/apache/spark/pull/45313
### What changes were proposed in this pull request?
This PR aims to support `spark.driver.timeout` and `DriverTimeoutPlugin`.
### Why are the changes needed?
Sometime, Spark applications fall into abnormal situation and hang.
We had better provide a way to guarantee the termination after pre-defined
timeout via a standard way.
- spark.plugins=org.apache.spark.deploy.DriverTimeoutPlugin
- spark.driver.timeout=1min
```
$ bin/spark-shell -c
spark.plugins=org.apache.spark.deploy.DriverTimeoutPlugin -c
spark.driver.timeout=1min
Setting default log level to "WARN".
To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use
setLogLevel(newLevel).
Welcome to
____ __
/ __/__ ___ _____/ /__
_\ \/ _ \/ _ `/ __/ '_/
/___/ .__/\_,_/_/ /_/\_\ version 4.0.0-SNAPSHOT
/_/
Using Scala version 2.13.12 (OpenJDK 64-Bit Server VM, Java 17.0.10)
Type in expressions to have them evaluated.
Type :help for more information.
24/02/28 00:57:08 WARN NativeCodeLoader: Unable to load native-hadoop
library for your platform... using builtin-java classes where applicable
Spark context Web UI available at http://localhost:4040
Spark context available as 'sc' (master = local[*], app id =
local-1709110629001).
Spark session available as 'spark'.
scala> %
$ echo $?
124
```
### Does this PR introduce _any_ user-facing change?
No, this is a new feature and a built-in plugin.
### How was this patch tested?
Manually because this invokes `System.exit`.
**Timeout with 1 minute**
```
$ bin/spark-shell -c
spark.plugins=org.apache.spark.deploy.DriverTimeoutPlugin -c
spark.driver.timeout=1min
```
**`DriverTimeoutPlugin` will be ignored if the default value of
`spark.driver.timeout` is used**
```
$ bin/spark-shell -c
spark.plugins=org.apache.spark.deploy.DriverTimeoutPlugin
...
24/02/28 01:02:57 WARN DriverTimeoutDriverPlugin: Disabled with the timeout
value 0.
...
scala>
```
### Was this patch authored or co-authored using generative AI tooling?
No.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]