-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Suppress hdfsFixture if there are spaces in the path #30302
Merged
DaveCTurner
merged 2 commits into
elastic:master
from
DaveCTurner:2018-05-01-hdfs-tests-require-no-spaces
May 11, 2018
+11
−1
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure a regular space in the path is what was causing the original issue. The issue was because a space character was HTTP encoded to
%20
(and then encoded again to%2520
). The%
sign with numbers trips up string formatting in Java, which is what caused the exception.Perhaps it might make sense to try formatting the string the same way HDFS does in a try block, catch the exception and mark the path illegal in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The offending code in HDFS does:
Which checks the name format eagerly to make sure it works with:
So perhaps we could try formatting the string the exact same way HDFS does to ensure max compatibility in this regard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, the URL encoding hasn't happened by this point, so looking for a literal space finds the issue here:
However, from the code you've shown it looks like any path that contains anything that needs URL-encoding is going to cause issues here -
%
for instance - so I agree that trying to catch anIllegalFormatException
seems like it'll be more faithful. Can you dig out how the URL-encoding is happening (e.g. does it usejava.net.URLEncoder
(twice?!) or is it more complicated)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good question. I'll take a look but I wouldn't be surprised if its something deep in Hadoop or far away from where it's breaking. If it's not encoded at this point the space check should be fine enough then. Thanks!