Skip to content

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

Closed
smengcl wants to merge 1 commit intoapache:masterfrom
smengcl:IMPALA-14955-stacktrace
Closed

IMPALA-14955: Include libhdfs Java stack trace in HDFS error messages#89
smengcl wants to merge 1 commit intoapache:masterfrom
smengcl:IMPALA-14955-stacktrace

Conversation

@smengcl
Copy link
Copy Markdown

@smengcl smengcl commented May 7, 2026

https://issues.apache.org/jira/browse/IMPALA-14955

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.

Motivation

We hit an issue earlier when using Ozone (HCFS):

Failed to close HDFS file
Error(255): Unknown error 255
Root cause: ArrayIndexOutOfBoundsException

but the actual Java stack trace was not captured in the query/profile error. Including the libhdfs stack trace would be help immensely.

Copilot AI review requested due to automatic review settings May 7, 2026 01:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Impala’s HDFS/libhdfs error-message helper to include the full Java exception stack trace (when available), improving debuggability for filesystem-client failures (e.g., HCFS/Ozone) where the root cause alone is insufficient.

Changes:

  • Append hdfsGetLastExceptionStackTrace() output to GetHdfsErrorMsg() when libhdfs provides it.
  • Preserve existing errno + root-cause reporting behavior while enriching failure context.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread be/src/util/hdfs-util.cc
Comment on lines +54 to +57
char* stack_trace = hdfsGetLastExceptionStackTrace();
if (stack_trace != nullptr) {
ss << "\nStack trace:\n" << stack_trace;
}
@stiga-huang
Copy link
Copy Markdown
Contributor

Hi @smengcl, thanks for submitting this PR! We use Gerrit for code review: https://cwiki.apache.org/confluence/display/IMPALA/Using+Gerrit+to+submit+and+review+patches

Please submit the patch in Gerrit. Thanks!

@smengcl
Copy link
Copy Markdown
Author

smengcl commented May 7, 2026

Hi @smengcl, thanks for submitting this PR! We use Gerrit for code review: cwiki.apache.org/confluence/display/IMPALA/Using+Gerrit+to+submit+and+review+patches

Please submit the patch in Gerrit. Thanks!

Ah, got it. Thanks

@smengcl smengcl closed this May 7, 2026
@smengcl
Copy link
Copy Markdown
Author

smengcl commented May 7, 2026

The patch has been moved to Gerrit for review: https://gerrit.cloudera.org/c/24280/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants