You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2025/01/24 05:13:08 UTC

(spark) branch branch-4.0 updated: [SPARK-50971][CORE] Combine the two retrievals of `taskDescription` in `CoarseGrainedExecutorBackend#statusUpdate`

This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new 38e39cb35f2c [SPARK-50971][CORE] Combine the two retrievals of `taskDescription` in `CoarseGrainedExecutorBackend#statusUpdate`
38e39cb35f2c is described below

commit 38e39cb35f2c44537a51b43dceb0bb9e17c3155d
Author: yangjie01 <ya...@baidu.com>
AuthorDate: Thu Jan 23 21:12:49 2025 -0800

    [SPARK-50971][CORE] Combine the two retrievals of `taskDescription` in `CoarseGrainedExecutorBackend#statusUpdate`
    
    ### What changes were proposed in this pull request?
    This PR reduces the two retrievals of `taskDescription` in `CoarseGrainedExecutorBackend#statusUpdate` to one.
    
    ### Why are the changes needed?
    Combine the two retrievals of `taskDescription` in `CoarseGrainedExecutorBackend#statusUpdate`
    
    ### Does this PR introduce _any_ user-facing change?
    No
    
    ### How was this patch tested?
    - Pass GitHub Acitions
    
    ### Was this patch authored or co-authored using generative AI tooling?
    No
    
    Closes #49638 from LuciferYang/taskDescription.
    
    Authored-by: yangjie01 <ya...@baidu.com>
    Signed-off-by: Dongjoon Hyun <do...@apache.org>
    (cherry picked from commit 1569c8a33aa6baecc4018c97c4471f9249512389)
    Signed-off-by: Dongjoon Hyun <do...@apache.org>
---
 .../org/apache/spark/executor/CoarseGrainedExecutorBackend.scala     | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala b/core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala
index a73380cab690..a30759e5d794 100644
--- a/core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala
+++ b/core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala
@@ -265,8 +265,9 @@ private[spark] class CoarseGrainedExecutorBackend(
   }
 
   override def statusUpdate(taskId: Long, state: TaskState, data: ByteBuffer): Unit = {
-    val resources = executor.runningTasks.get(taskId).taskDescription.resources
-    val cpus = executor.runningTasks.get(taskId).taskDescription.cpus
+    val taskDescription = executor.runningTasks.get(taskId).taskDescription
+    val resources = taskDescription.resources
+    val cpus = taskDescription.cpus
     val msg = StatusUpdate(executorId, taskId, state, data, cpus, resources)
     if (TaskState.isFinished(state)) {
       lastTaskFinishTime.set(System.nanoTime())


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org