haoyangeng-db opened a new pull request, #58134:
URL: https://github.com/apache/spark/pull/58134

   ### What changes were proposed in this pull request?
   
   Follow-up to #57837, which made the fallback (`UNKNOWN`) gRPC error 
description non-empty. This applies the same class-name fallback to the 
non-fatal `INTERNAL` path.
   
   `ErrorUtils.buildStatusFromThrowable` took its status message from 
`SparkConnectService.extractErrorMessage`, which abbreviated `getMessage` and 
then mapped `null` to `""`. Since `Utils.abbreviate(null, 2048)` returns 
`null`, a non-fatal throwable with no message produced an `INTERNAL` status 
with an empty message.
   
   The message now comes from the helper added in #57837, renamed from 
`fallbackErrorDescription` to `errorDescription` since it is no longer used 
only by the fallback path. `SparkConnectService.extractErrorMessage` and 
`convertNullString` are left with no callers and are removed.
   
   ### Why are the changes needed?
   
   A message-less non-fatal exception, for example a bare `new 
RuntimeException()`, reached the client as an `INTERNAL` error with no 
description at all, giving no indication of what failed. This is the same gap 
#57837 closed for the fatal path.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. For an already-failing request whose non-fatal throwable has no 
message, the client now receives the throwable's fully qualified class name 
instead of an empty error message. This also covers a throwable whose message 
is the empty string, which previously produced an empty message as well.
   
   Successful requests, and errors whose throwable has a non-empty message, are 
unchanged.
   
   ### How was this patch tested?
   
   Added three cases to `ErrorUtilsSuite` for `buildStatusFromThrowable`: a 
throwable with no message and a throwable with an empty message both yield 
`java.lang.RuntimeException` as the status message, and a throwable with a 
message keeps that message.
   
   The suite could not be run locally because the SBT launcher and Maven 
dependencies are unreachable in my development environment, so it runs in CI. 
Static checks passed: no remaining reference to the removed helpers anywhere in 
the tree, and every touched file's imports are still used.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Co-authored with Claude Code
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to