-
Notifications
You must be signed in to change notification settings - Fork 534
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
[INLONG-4203][Manager] Improve HTTP request and response parse in manager client #4204
Conversation
@shink The |
@kipshi This PR involves the manager client, PTAL. |
@healchow Please check out actions/first-interaction#31 (comment). We need |
@healchow Fixed in #4206, please review. |
#4206 was merged. @leosanqing Please rebase the master branch into your PR, thanks. |
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 found that the rebase occurred with some unexpected changes, please reset from the master branch, and commit again. Thanks a lot.
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.
LGTM
Title Name: [INLONG-4203][Manager] Improve http request and response parse in manager client
Fixes #4203
Motivation
The stream of the HTTP request is not closed, which may cause a leak
When creating an OkHttp request, there is redundant code. After the get() param, post() is used, and it can also be simplified.
When parsing the response, the processing is a bit cumbersome, and the generic type is not used
Modifications
Use try-with-resources to prevent unclosed streams
Provide a new JSON parsing method to easily parse the response of HTTP requests
Correct some wrong usage of creating OkHttp Request object
Verifying this change
Documentation