You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celeborn.apache.org by zh...@apache.org on 2023/08/17 03:01:32 UTC
[incubator-celeborn] branch main updated: [CELEBORN-899] Fix potential NPE in ShuffleClientImpl#revive
This is an automated email from the ASF dual-hosted git repository.
zhouky pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git
The following commit(s) were added to refs/heads/main by this push:
new 30d979f68 [CELEBORN-899] Fix potential NPE in ShuffleClientImpl#revive
30d979f68 is described below
commit 30d979f6854508824531e553b289119da89ae565
Author: liangyongyuan <li...@xiaomi.com>
AuthorDate: Thu Aug 17 11:01:23 2023 +0800
[CELEBORN-899] Fix potential NPE in ShuffleClientImpl#revive
### What changes were proposed in this pull request?
After obtaining the results of reviveBatch, determine whether it contains the corresponding partitionId.
### Why are the changes needed?
that maybe cause npe in some versions of jdk8.The decompilation result is as follows

### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
through existing uts
Closes #1819 from lyy-pineapple/fix-npe.
Authored-by: liangyongyuan <li...@xiaomi.com>
Signed-off-by: zky.zhoukeyong <zk...@alibaba-inc.com>
---
.../src/main/java/org/apache/celeborn/client/ShuffleClientImpl.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/client/src/main/java/org/apache/celeborn/client/ShuffleClientImpl.java b/client/src/main/java/org/apache/celeborn/client/ShuffleClientImpl.java
index 992597521..05c7475ca 100644
--- a/client/src/main/java/org/apache/celeborn/client/ShuffleClientImpl.java
+++ b/client/src/main/java/org/apache/celeborn/client/ShuffleClientImpl.java
@@ -675,7 +675,9 @@ public class ShuffleClientImpl extends ShuffleClient {
attemptId,
partitionId);
return true;
- } else if (results == null || results.get(partitionId) != StatusCode.SUCCESS.getValue()) {
+ } else if (results == null
+ || !results.containsKey(partitionId)
+ || results.get(partitionId) != StatusCode.SUCCESS.getValue()) {
return false;
} else {
return true;