[ 
https://issues.apache.org/jira/browse/IMPALA-14955?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18079547#comment-18079547
 ] 

ASF subversion and git services commented on IMPALA-14955:
----------------------------------------------------------

Commit 9384d46e4ed0344f21e8832069e16e0ee1fefcf6 in impala's branch 
refs/heads/master from Siyao Meng
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=9384d46e4 ]

IMPALA-14955: Include libhdfs Java stack trace in HDFS error messages

When a libhdfs call fails, GetHdfsErrorMsg() currently reports errno and
the Java exception root cause, but it does not include the Java stack
trace that libhdfs also exposes.

For HCFS connection failures, the root cause alone is often not enough
to understand where the error came from in the Java client stack. This
makes coordinator-side failures harder to debug from the Impala error
message alone.

Append hdfsGetLastExceptionStackTrace() to the existing error message
when it is available. This keeps the current behavior for errno and root
cause, and adds the extra Java context only when libhdfs has captured
it.

Testing:
- Manually validated through live impalad
- Created a native UDF, rewrote its stored LOCATION to an invalid
  HCFS URI, and ran select default.__impala14955_runtime(7)
- Verified the unpatched error showed Failed to connect to FS,
  Error(255), and Root cause without a stack trace section
- Verified the patched error showed the same failure plus stack trace
  and Java frames from the underlying Java client

Before:

2026-05-08 02:49:13 [Exception]  ERROR: Query c04984ff1e7a68e3:6636088e00000000 
failed:
Problem loading UDF '__impala14955_runtime':
Failed to connect to FS: o3fs://nosuchbucket.nosuchvol.ozone1778185853/
Error(255): Unknown error 255
Root cause: OMException: Volume nosuchvol is not found

After:

2026-05-08 04:25:29 [Exception]  ERROR: Query 4b47a57277e156f6:920385c300000000 
failed:
Problem loading UDF '__impala14955_runtime':
Failed to connect to FS: o3fs://nosuchbucket.nosuchvol.ozone1778185853/
Error(255): Unknown error 255
Root cause: OMException: Volume nosuchvol is not found
Stack trace:
VOLUME_NOT_FOUND org.apache.hadoop.ozone.om.exceptions.OMException: Volume 
nosuchvol is not found
        at 
org.apache.hadoop.ozone.om.protocolPB.OzoneManagerProtocolClientSideTranslatorPB.handleError(OzoneManagerProtocolClientSideTranslatorPB.java:761)
        at 
org.apache.hadoop.ozone.om.protocolPB.OzoneManagerProtocolClientSideTranslatorPB.getVolumeInfo(OzoneManagerProtocolClientSideTranslatorPB.java:460)
        at 
org.apache.hadoop.ozone.client.rpc.RpcClient.getVolumeDetails(RpcClient.java:497)
        at 
org.apache.hadoop.ozone.client.ObjectStore.getVolume(ObjectStore.java:185)
        at 
org.apache.hadoop.fs.ozone.BasicOzoneClientAdapterImpl.<init>(BasicOzoneClientAdapterImpl.java:197)
        at 
org.apache.hadoop.fs.ozone.OzoneClientAdapterImpl.<init>(OzoneClientAdapterImpl.java:50)
        at 
org.apache.hadoop.fs.ozone.OzoneFileSystem.createAdapter(OzoneFileSystem.java:107)
        at 
org.apache.hadoop.fs.ozone.BasicOzoneFileSystem.initialize(BasicOzoneFileSystem.java:199)
        at 
org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:3615)
        at 
org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:3716)
        at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:3667)
        at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:557)
        at org.apache.hadoop.fs.FileSystem$1.run(FileSystem.java:277)
        at org.apache.hadoop.fs.FileSystem$1.run(FileSystem.java:274)
        at 
java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
        at java.base/javax.security.auth.Subject.doAs(Subject.java:439)
        at 
org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1964)
        at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:274)

Change-Id: I67b588a7d8ab11bbbc4480d9abaa6e529c6ec3c2
Reviewed-on: http://gerrit.cloudera.org:8080/24280
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>


> Include libhdfs Java stack trace in HDFS error messages
> -------------------------------------------------------
>
>                 Key: IMPALA-14955
>                 URL: https://issues.apache.org/jira/browse/IMPALA-14955
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Backend
>            Reporter: Siyao Meng
>            Assignee: Siyao Meng
>            Priority: Major
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> When an HDFS/libhdfs operation fails, Impala currently includes libhdfs root 
> cause output in `GetHdfsErrorMsg()`. However, some failures, especially 
> exceptions raised inside filesystem client code, need the full Java stack 
> trace to identify the actual failing path.
> This change appends `hdfsGetLastExceptionStackTrace()` to the HDFS error 
> message when libhdfs provides one.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to