This is an automated email from the ASF dual-hosted git repository.
zuston pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/uniffle.git
The following commit(s) were added to refs/heads/master by this push:
new ccc534be5 [#2539] fix(spark): NPE in DataPusher when sendShuffleData
fails (#2556)
ccc534be5 is described below
commit ccc534be53827889fab2ce2d98af7f974757f54b
Author: Yunchi Pang <[email protected]>
AuthorDate: Fri Jul 25 01:51:32 2025 -0700
[#2539] fix(spark): NPE in DataPusher when sendShuffleData fails (#2556)
### What changes were proposed in this pull request?
`NullPointerException` occurs in `DataPusher` when `sendShuffleData()`
throws an exception, leaving `result` null, but the finally block attempts to
access `result.getShuffleServerPushCostTracker()` without null checking.
### Why are the changes needed?
Add null check to `result` before accessing shuffle server push cost
tracker.
Fix: #2539
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
`DataPusherTest` passes.
Signed-off-by: Yunchi Pang <[email protected]>
---
.../src/main/java/org/apache/spark/shuffle/writer/DataPusher.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/client-spark/common/src/main/java/org/apache/spark/shuffle/writer/DataPusher.java
b/client-spark/common/src/main/java/org/apache/spark/shuffle/writer/DataPusher.java
index 1926f31b2..9c74e328b 100644
---
a/client-spark/common/src/main/java/org/apache/spark/shuffle/writer/DataPusher.java
+++
b/client-spark/common/src/main/java/org/apache/spark/shuffle/writer/DataPusher.java
@@ -113,7 +113,7 @@ public class DataPusher implements Closeable {
taskToFailedBlockSendTracker, taskId,
result.getFailedBlockSendTracker());
} finally {
WriteBufferManager bufferManager = event.getBufferManager();
- if (bufferManager != null) {
+ if (bufferManager != null && result != null) {
ShuffleServerPushCostTracker shuffleServerPushCostTracker =
result.getShuffleServerPushCostTracker();
bufferManager.merge(shuffleServerPushCostTracker);