apache / pulsar

Apache Pulsar - distributed pub-sub messaging system
https://pulsar.apache.org/
Apache License 2.0
14.26k stars 3.59k forks source link

[improve][admin] Print error log if handle http response fails #23563

Closed poorbarcode closed 1 week ago

poorbarcode commented 2 weeks ago

Motivation

When users are calling pulsar-admin API, and there is an internal error( such as a deserialize JSON error), there is no error log.

You can test it this way:

Modifications

Print error log if handle HTTP response fails

Documentation

Matching PR in forked repository

PR in forked repository: x

codecov-commenter commented 1 week ago

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 74.33%. Comparing base (bbc6224) to head (368653b). Report is 714 commits behind head on master.

Files with missing lines Patch % Lines
...client/admin/internal/http/AsyncHttpConnector.java 50.00% 2 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/apache/pulsar/pull/23563/graphs/tree.svg?width=650&height=150&src=pr&token=acYqCpsK9J&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/pulsar/pull/23563?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) ```diff @@ Coverage Diff @@ ## master #23563 +/- ## ============================================ + Coverage 73.57% 74.33% +0.75% - Complexity 32624 34327 +1703 ============================================ Files 1877 1943 +66 Lines 139502 147056 +7554 Branches 15299 16210 +911 ============================================ + Hits 102638 109310 +6672 - Misses 28908 29327 +419 - Partials 7956 8419 +463 ``` | [Flag](https://app.codecov.io/gh/apache/pulsar/pull/23563/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [inttests](https://app.codecov.io/gh/apache/pulsar/pull/23563/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `27.65% <50.00%> (+3.07%)` | :arrow_up: | | [systests](https://app.codecov.io/gh/apache/pulsar/pull/23563/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `24.37% <50.00%> (+0.04%)` | :arrow_up: | | [unittests](https://app.codecov.io/gh/apache/pulsar/pull/23563/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.72% <50.00%> (+0.87%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/apache/pulsar/pull/23563?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [...client/admin/internal/http/AsyncHttpConnector.java](https://app.codecov.io/gh/apache/pulsar/pull/23563?src=pr&el=tree&filepath=pulsar-client-admin%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpulsar%2Fclient%2Fadmin%2Finternal%2Fhttp%2FAsyncHttpConnector.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWNsaWVudC1hZG1pbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9hZG1pbi9pbnRlcm5hbC9odHRwL0FzeW5jSHR0cENvbm5lY3Rvci5qYXZh) | `85.15% <50.00%> (-1.27%)` | :arrow_down: | ... and [655 files with indirect coverage changes](https://app.codecov.io/gh/apache/pulsar/pull/23563/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)