-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HADOOP-18928: S3AFileSystem URL encodes twice where Path has trailing / #6167
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
Conversation
Change-Id: I4062dc67013511ea0d240b9461aff8063c00ea39
|
🎊 +1 overall
This message was automatically generated. |
ayushtkn
left a comment
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.
Patches against object stores require manual testing:
https://cwiki.apache.org/confluence/display/hadoop/how+to+contribute#HowToContribute-SubmittingpatchesagainstobjectstoressuchasAmazonS3,OpenStackSwiftandMicrosoftAzure
|
🎊 +1 overall
This message was automatically generated. |
steveloughran
left a comment
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.
we've had problems with spaces in things before (s3a committers) because there's not enough testing/production use of them. So I accept that this is probably an issue.
- can you do what i've suggested about pulling the code from s3afs into a static S3AUtils method, so it can be tested in a (new) unit test.
- and as noted, all hadoop-aws tests require the submitter to run the entire suite against an s3 store -and tell us which endpoint/arguments you used. Yetus can't be given the credentials, see.
| try { | ||
| q = new Path(new URI(urlString.substring(0, urlString.length() - 1))); | ||
| } catch (URISyntaxException e) { | ||
| LOG.error(String.format("Error removing trailing / from path %s", path.toString())); |
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.
- We'd want a LogExactlyOnce so if there is a problem it only ever gets logged once, not every time a path was loaded.
- it should be at warn, not error
- +use slf4j {} expansions.
thanks
| if (urlString.endsWith(Path.SEPARATOR)) { | ||
| // this is a path which needs root stripping off to avoid | ||
| // confusion, See HADOOP-15430 | ||
| LOG.debug("Stripping trailing '/' from {}", q); |
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.
how about pulling out everything in this method after the super.makeQualified(path); call into a static method in S3AUtils? that way it could be tested in a unit test rather than waiting until someone runs the integration tests. faster and with yetus coverage
|
We're closing this stale PR because it has been open for 100 days with no activity. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. |
|
@ahmarsuhail @mukund-thakur @shameersss1 what do people think here? |
|
As per the description the issue happens with S3Guard #1646 (comment) which is no longer there |
As per the comment at #1646 (comment) ...
due to HADOOP-15430 a Path
s3://my.bucket/my folder/becomes
s3://my.bucket/my%20folderwhich upon HTTP request creation becomes
"GET ...&prefix=my%2520folder which is a wrong path.This PR re-adds the missing step of converting the modified String back to URI before creating a Path out of it.
cc: @steveloughran @bgaborg @whenamanlies