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

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


The following commit(s) were added to refs/heads/branch-3.5 by this push:
     new 6313e6cc5090 [SPARK-45906][YARN] Fix error message extraction from 
ResourceNotFoundException
6313e6cc5090 is described below

commit 6313e6cc5090036eacb9c234584705d4b398c39e
Author: Cheng Pan <cheng...@apache.org>
AuthorDate: Mon Nov 13 19:31:22 2023 +0800

    [SPARK-45906][YARN] Fix error message extraction from 
ResourceNotFoundException
    
    ### What changes were proposed in this pull request?
    
    This PR aims to fix the error message extraction from 
`ResourceNotFoundException`, the current wrong implementation also has a 
potential NPE issue.
    
    ### Why are the changes needed?
    
    This bug is introduced in SPARK-43202, previously, `e.getCause()` is used 
to unwrap `InvocationTargetException`, after replacing reflection invocation 
with direct API calling, we should not apply `getCause()`.
    
    ### Does this PR introduce _any_ user-facing change?
    
    Yes, bug fix.
    
    ### How was this patch tested?
    
    Review.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #43782 from pan3793/SPARK-45906.
    
    Authored-by: Cheng Pan <cheng...@apache.org>
    Signed-off-by: Kent Yao <y...@apache.org>
    (cherry picked from commit c29b127dcdd99b0038e96b90177b44b828b32c4b)
    Signed-off-by: Kent Yao <y...@apache.org>
---
 .../main/scala/org/apache/spark/deploy/yarn/ResourceRequestHelper.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/ResourceRequestHelper.scala
 
b/resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/ResourceRequestHelper.scala
index 0dd4e0a6c8ad..f9aa11c4d48d 100644
--- 
a/resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/ResourceRequestHelper.scala
+++ 
b/resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/ResourceRequestHelper.scala
@@ -168,7 +168,7 @@ private object ResourceRequestHelper extends Logging {
           if (numResourceErrors < 2) {
             logWarning(s"YARN doesn't know about resource $name, your resource 
discovery " +
               s"has to handle properly discovering and isolating the resource! 
Error: " +
-              s"${e.getCause.getMessage}")
+              s"${e.getMessage}")
             numResourceErrors += 1
           }
       }


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

Reply via email to