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

angerszhuuuu 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 9502b1f26 [CELEBORN-639][BUG] ShuffleClient get push exception cause 
should handle NPE
9502b1f26 is described below

commit 9502b1f26d572bf8e4547502aec391789181ccae
Author: Angerszhuuuu <[email protected]>
AuthorDate: Wed Jun 7 15:15:58 2023 +0800

    [CELEBORN-639][BUG] ShuffleClient get push exception cause should handle NPE
    
    ### What changes were proposed in this pull request?
    If we meet some unexpected exception, `getPushDataFailCause ` will throw 
NPE and broke the process of revive and remove push states. Here we should 
handle the NPE
    
    ### Why are the changes needed?
    
    ### Does this PR introduce _any_ user-facing change?
    
    ### How was this patch tested?
    
    Closes #1551 from AngersZhuuuu/CELEBORN-639.
    
    Authored-by: Angerszhuuuu <[email protected]>
    Signed-off-by: Angerszhuuuu <[email protected]>
---
 .../src/main/java/org/apache/celeborn/client/ShuffleClientImpl.java  | 5 ++++-
 1 file changed, 4 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 5bf9ea392..b9c7110da 100644
--- a/client/src/main/java/org/apache/celeborn/client/ShuffleClientImpl.java
+++ b/client/src/main/java/org/apache/celeborn/client/ShuffleClientImpl.java
@@ -1534,7 +1534,10 @@ public class ShuffleClientImpl extends ShuffleClient {
   private StatusCode getPushDataFailCause(String message) {
     logger.debug("Push data failed cause message: " + message);
     StatusCode cause;
-    if (message.startsWith(StatusCode.PUSH_DATA_WRITE_FAIL_SLAVE.name())) {
+    if (message == null) {
+      logger.error("Push data throw unexpected exception: {}", message);
+      cause = StatusCode.PUSH_DATA_FAIL_NON_CRITICAL_CAUSE;
+    } else if 
(message.startsWith(StatusCode.PUSH_DATA_WRITE_FAIL_SLAVE.name())) {
       cause = StatusCode.PUSH_DATA_WRITE_FAIL_SLAVE;
     } else if 
(message.startsWith(StatusCode.PUSH_DATA_WRITE_FAIL_MASTER.name())) {
       cause = StatusCode.PUSH_DATA_WRITE_FAIL_MASTER;

Reply via email to