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

wenchen 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 769ccc62679a [SPARK-54533][UI] Set metric 
ExecutorSource.METRIC_RESULT_SIZE with correct value
769ccc62679a is described below

commit 769ccc62679a4ab49c148d00400a623d12575566
Author: Eric Yang <[email protected]>
AuthorDate: Tue Dec 2 14:37:07 2025 -0800

    [SPARK-54533][UI] Set metric ExecutorSource.METRIC_RESULT_SIZE with correct 
value
    
    ### What changes were proposed in this pull request?
    Set the metric executorSource.METRIC_RESULT_SIZE after the result size is 
populated.
    
    ### Why are the changes needed?
    Currently the metric executorSource.METRIC_RESULT_SIZE is set to the value 
of `task.metrics.resultSize` which is always 0 in that line.
    
    ### Does this PR introduce _any_ user-facing change?
    No
    
    ### How was this patch tested?
    Manually tested on local Spark. See the Jira attachments for metrics 
reported before and after fix.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    No
    
    Closes #53243 from jiwen624/executor-source-result-size.
    
    Authored-by: Eric Yang <[email protected]>
    Signed-off-by: Wenchen Fan <[email protected]>
---
 core/src/main/scala/org/apache/spark/executor/Executor.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/src/main/scala/org/apache/spark/executor/Executor.scala 
b/core/src/main/scala/org/apache/spark/executor/Executor.scala
index 04e966294336..53c791a3446c 100644
--- a/core/src/main/scala/org/apache/spark/executor/Executor.scala
+++ b/core/src/main/scala/org/apache/spark/executor/Executor.scala
@@ -764,7 +764,6 @@ private[spark] class Executor(
           .inc(task.metrics.outputMetrics.bytesWritten)
         executorSource.METRIC_OUTPUT_RECORDS_WRITTEN
           .inc(task.metrics.outputMetrics.recordsWritten)
-        executorSource.METRIC_RESULT_SIZE.inc(task.metrics.resultSize)
         
executorSource.METRIC_DISK_BYTES_SPILLED.inc(task.metrics.diskBytesSpilled)
         
executorSource.METRIC_MEMORY_BYTES_SPILLED.inc(task.metrics.memoryBytesSpilled)
         incrementShuffleMetrics(executorSource, task.metrics)
@@ -778,6 +777,7 @@ private[spark] class Executor(
         val serializedDirectResult = 
SerializerHelper.serializeToChunkedBuffer(ser, directResult,
           valueByteBuffer.size + accumUpdates.size * 32 + metricPeaks.length * 
8)
         val resultSize = serializedDirectResult.size
+        executorSource.METRIC_RESULT_SIZE.inc(resultSize)
 
         // directSend = sending directly back to the driver
         val serializedResult: ByteBuffer = {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to