-
Notifications
You must be signed in to change notification settings - Fork 8.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
HADOOP-18890: remove use of okhttp in runtime code #6057
Conversation
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
@rohit-kb what do you think of this? would it suit? |
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.
made some minor suggestions
"Received invalid http response: " + statusCode + ", text = " + | ||
EntityUtils.toString(response.getEntity())); | ||
} | ||
Map<?, ?> responseBody = JsonSerialization.mapReader().readValue( |
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.
let's check the return content type too; been burned by both proxies and how the abfs oauth failure is 200 + text/html for users.
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 pre-existing code did not check the content-type of the return. It is not uncommon for an API to return JSON but not to have application/json
Content-Type. I can make the change but I'm worried that the API we call may not set the expected content-type on the response.
|
||
accessToken = responseBody.get(ACCESS_TOKEN).toString(); | ||
} catch (RuntimeException e) { | ||
throw new IOException("Unable to obtain access token from credential", e); |
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.
add e.toString to the text
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 duplicating this because Spotbugs has its weird rules. The pre-existing catch already does this - do I change all the catches?
|
||
accessToken = responseBody.get(ACCESS_TOKEN).toString(); | ||
} catch (RuntimeException e) { | ||
throw new IOException("Unable to obtain access token from credential", e); | ||
} catch (Exception e) { |
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.
this is now a duplicate of the handler above, isn't it? so they can be collapsed
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.
Spotbugs is what is making me duplicate the catch. It doesn't like catches of Exception and this is one workaround.
Thanks for the heads-up @steveloughran. I think it's a welcome change w.r.t to okhttp and related kotlin dependencies removal. Just need to check if it's causing any issues in any other components downstream. Thanks @pjfanning for looking into this. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
e70ad48
to
0bb3e35
Compare
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.
code change looks good, do want the base dependency restored to the project pom for inheritors to reference.
@@ -391,11 +391,19 @@ | |||
<dependency> | |||
<groupId>com.squareup.okhttp3</groupId> | |||
<artifactId>mockwebserver</artifactId> | |||
<version>${okhttp3.version}</version> |
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.
prefer hadoop-project retains the declaration, but now with all the excludes. the modules should get the exclusions automatically, shouldn't they?
@@ -220,62 +218,6 @@ | |||
|
|||
<dependencyManagement> | |||
<dependencies> | |||
<dependency> |
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.
this should be reinstated with the new exclusions; then the test declarations don't need changing.
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've committed some changes to bring back some of dependency management to this pom
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.
thanks
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
test failures are unrelated; the timeline one has been seen before YARN-11546 |
+1 merged to trunk. presumably it needs a backport? |
Contributed by PJ Fanning
I created #6101 for backporting this. |
Contributed by PJ Fanning
Contributed by PJ Fanning
Contributed by PJ Fanning
Contributed by PJ Fanning
Description of PR
Use Apache HTTPClient instead of OkHTTP to reduce the number of hadoop dependencies.
https://issues.apache.org/jira/browse/HADOOP-18890
How was this patch tested?
Local build and CI build.
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?