You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by sr...@apache.org on 2022/08/13 00:10:24 UTC
[spark] branch master updated: [MINOR] To use the `Utils.tryLog` to eliminate duplicate code in `ExecutorAllocationManager.start` snippet
This is an automated email from the ASF dual-hosted git repository.
srowen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new f98364aa00f [MINOR] To use the `Utils.tryLog` to eliminate duplicate code in `ExecutorAllocationManager.start` snippet
f98364aa00f is described below
commit f98364aa00fe9219317a010366cdc0dfa0fd6ea5
Author: yikf <yi...@gmail.com>
AuthorDate: Fri Aug 12 19:10:03 2022 -0500
[MINOR] To use the `Utils.tryLog` to eliminate duplicate code in `ExecutorAllocationManager.start` snippet
### What changes were proposed in this pull request?
This pr aims to use the `Utils.tryLog` to eliminate duplicate code in `ExecutorAllocationManager.start` snippet. Other code snippets have been checked and there are no similar problems
### Why are the changes needed?
Code simplification
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
exist tests
Closes #37493 from yikf/executorAlloation-use-tryLog.
Authored-by: yikf <yi...@gmail.com>
Signed-off-by: Sean Owen <sr...@gmail.com>
---
.../scala/org/apache/spark/ExecutorAllocationManager.scala | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/core/src/main/scala/org/apache/spark/ExecutorAllocationManager.scala b/core/src/main/scala/org/apache/spark/ExecutorAllocationManager.scala
index b9bc3c63ff4..400c8524fc4 100644
--- a/core/src/main/scala/org/apache/spark/ExecutorAllocationManager.scala
+++ b/core/src/main/scala/org/apache/spark/ExecutorAllocationManager.scala
@@ -21,7 +21,7 @@ import java.util.concurrent.TimeUnit
import scala.collection.mutable
import scala.collection.mutable.ArrayBuffer
-import scala.util.control.{ControlThrowable, NonFatal}
+import scala.util.control.NonFatal
import com.codahale.metrics.{Counter, Gauge, MetricRegistry}
@@ -231,16 +231,7 @@ private[spark] class ExecutorAllocationManager(
cleaner.foreach(_.attachListener(executorMonitor))
val scheduleTask = new Runnable() {
- override def run(): Unit = {
- try {
- schedule()
- } catch {
- case ct: ControlThrowable =>
- throw ct
- case t: Throwable =>
- logWarning(s"Uncaught exception in thread ${Thread.currentThread().getName}", t)
- }
- }
+ override def run(): Unit = Utils.tryLog(schedule())
}
if (!testing || conf.get(TEST_DYNAMIC_ALLOCATION_SCHEDULE_ENABLED)) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org