-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HDFS-17791: Fix libhdfs client that needlessly outputs full stack trace for common "file not found" errors #7696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
Example of error message prior to this change. Part of the Java stack trace actually appears twice. A message like this appears in our logs for every "file not found" error.
|
With this patch, the error message for a non-existent file is brief and clear:
|
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
This PR fixes issue HDFS-17791.
The
libhdfs
client outputs a full Java stack trace in its error message for a "file not found" error. Our HDFS application processes numerous queries checking for the presence of files, so "file not found" errors are frequent. Each such error generates a very lengthy and useless Java stack trace. These traces have no diagnostic value, since the cause of the error is that the file doesn't exist.See the comment below for an example of the error with stack trace.
This PR eliminates the stack trace in the case of a "file not found" error. The stack trace will still be output for other kinds of errors.
How was this patch tested?
This patch was tested by loading it into our HDFS application and sending it queries for non-existent files. Concise and useful error messages resulted in the error log that no longer had the lengthy stack traces.
This patch only changes the
libhdfs
C API library.There's no change to HDFS itself. The effect of the change can only be seen in an application that useslibhdfs
to open files.