Skip to content

Commit

Permalink
Reduce noisy exceptions on StandaloneSchedulerBackend shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshRosen committed Feb 21, 2024
1 parent 9b53b80 commit d85a951
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package org.apache.spark.scheduler.cluster

import java.util.Locale
import java.util.concurrent.{Semaphore, TimeUnit}
import java.util.concurrent.{RejectedExecutionException, Semaphore, TimeUnit}
import java.util.concurrent.atomic.AtomicBoolean

import scala.concurrent.Future
Expand Down Expand Up @@ -343,8 +343,14 @@ private[spark] class StandaloneSchedulerBackend(
}
}
}
executorDelayRemoveThread.schedule(removeExecutorTask,
_executorRemoveDelay, TimeUnit.MILLISECONDS)
try {
executorDelayRemoveThread.schedule(removeExecutorTask,
_executorRemoveDelay, TimeUnit.MILLISECONDS)
} catch {
case _: RejectedExecutionException if stopping.get() =>
logWarning(
"Skipping onDisconnected RemoveExecutor call because the scheduler is stopping")
}
}
}
}
Expand Down

0 comments on commit d85a951

Please sign in to comment.