dongjoon-hyun commented on code in PR #51345:
URL: https://github.com/apache/spark/pull/51345#discussion_r2178705982
##########
core/src/main/scala/org/apache/spark/api/python/PythonWorkerFactory.scala:
##########
@@ -130,12 +130,13 @@ private[spark] class PythonWorkerFactory(
// Pull from idle workers until we one that is alive, otherwise create
a new one.
while (idleWorkers.nonEmpty) {
val worker = idleWorkers.dequeue()
- val workerHandle = daemonWorkers(worker)
- if (workerHandle.isAlive()) {
- try {
- return (worker.refresh(), Some(workerHandle))
- } catch {
- case c: CancelledKeyException => /* pass */
+ daemonWorkers.get(worker).foreach { workerHandle =>
+ if (workerHandle.isAlive()) {
+ try {
+ return (worker.refresh(), Some(workerHandle))
+ } catch {
+ case _: CancelledKeyException => /* pass */
+ }
}
}
Review Comment:
IIUC, after this PR, instead of showing `key not found`, it shows `Worker
xxx process from idle queue is dead, discarding.` and stopped the worker
directly?
--
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]