-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Open
cvuosalo
wants to merge
2
commits into
apache:trunk
Choose a base branch
from
cvuosalo:trunk
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+20
−6
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.