Skip to content

Commit a4e51a2

Browse files
committed
DSP-13836 reply implicit timeout is to short for closing ctx
Add explicit closing timeout for spark ctx shutdown
1 parent db02628 commit a4e51a2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

job-server/src/main/scala/spark/jobserver/WebApi.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ class WebApi(system: ActorSystem,
134134
.fold(100 * 1024)(config.getBytes(_).toInt)
135135

136136
val contextTimeout = SparkJobUtils.getContextCreationTimeout(config)
137+
val contextDeletionTimeout = SparkJobUtils.getContextDeletionTimeout(config)
137138
val bindAddress = config.getString("spark.jobserver.bind-address")
138139

139140
val logger = LoggerFactory.getLogger(getClass)
@@ -390,7 +391,7 @@ class WebApi(system: ActorSystem,
390391
// and currently running jobs will be lost. Use with care!
391392
path(Segment) { (contextName) =>
392393
val (cName, _) = determineProxyUser(config, authInfo, contextName)
393-
val future = supervisor ? StopContext(cName)
394+
val future = (supervisor ? StopContext(cName))(contextDeletionTimeout.seconds)
394395
respondWithMediaType(MediaTypes.`application/json`) { ctx =>
395396
future.map {
396397
case ContextStopped => ctx.complete(StatusCodes.OK, successMap("Context stopped"))

0 commit comments

Comments
 (0)