Skip to content
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

[fix][client] Fix update response body text #18794

Merged
merged 2 commits into from
Dec 15, 2022

Conversation

tuteng
Copy link
Member

@tuteng tuteng commented Dec 7, 2022

Fixes #xyz

Master Issue: #xyz

Motivation

When using pulsar-admin and encountering an exception, first check the body, then check the http text

Modifications

  • Update http response body check

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: AmateurEvents#31

@github-actions
Copy link

github-actions bot commented Dec 7, 2022

@tuteng Please add the following content to your PR description and select a checkbox:

- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->

@github-actions github-actions bot added doc-label-missing doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Dec 7, 2022
@tuteng tuteng requested review from Demogorgon314, Technoboy- and mattisonchao and removed request for Demogorgon314 December 7, 2022 07:06
@tuteng tuteng self-assigned this Dec 7, 2022
@tuteng tuteng added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages area/client area/cli component/client-java labels Dec 7, 2022
@tuteng tuteng changed the title [Bug][pulsar-client]Fixed update response body text [Improve][pulsar-client]Fixed update response body text Dec 7, 2022
@tuteng tuteng changed the title [Improve][pulsar-client]Fixed update response body text [improve][pulsar-client]Fixed update response body text Dec 7, 2022
@tuteng tuteng changed the title [improve][pulsar-client]Fixed update response body text [fixed][client]Fixed update response body text Dec 12, 2022
@tuteng tuteng changed the title [fixed][client]Fixed update response body text [fix][client]Fixed update response body text Dec 12, 2022
@Technoboy- Technoboy- changed the title [fix][client]Fixed update response body text [fix][client] Fix update response body text Dec 12, 2022
@Technoboy- Technoboy- closed this Dec 12, 2022
@Technoboy- Technoboy- reopened this Dec 12, 2022
@Technoboy- Technoboy- closed this Dec 12, 2022
@Technoboy- Technoboy- reopened this Dec 12, 2022
Copy link
Member

@mattisonchao mattisonchao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, We need to see if we break unit test.

@codecov-commenter
Copy link

codecov-commenter commented Dec 12, 2022

Codecov Report

Merging #18794 (63e4b48) into master (99e26f5) will decrease coverage by 7.62%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #18794      +/-   ##
============================================
- Coverage     44.79%   37.16%   -7.63%     
+ Complexity    10026     6977    -3049     
============================================
  Files           703      623      -80     
  Lines         68808    59099    -9709     
  Branches       7375     6146    -1229     
============================================
- Hits          30822    21967    -8855     
+ Misses        34378    34294      -84     
+ Partials       3608     2838     -770     
Flag Coverage Δ
unittests 37.16% <0.00%> (-7.63%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...he/pulsar/client/impl/MultiTopicsConsumerImpl.java 22.78% <0.00%> (-0.20%) ⬇️
...ava/org/apache/pulsar/broker/admin/v1/Brokers.java 0.00% <0.00%> (-100.00%) ⬇️
...va/org/apache/pulsar/broker/admin/v1/Clusters.java 0.00% <0.00%> (-100.00%) ⬇️
.../org/apache/pulsar/broker/admin/v1/Properties.java 0.00% <0.00%> (-100.00%) ⬇️
...ar/common/naming/PartitionedManagedLedgerInfo.java 0.00% <0.00%> (-100.00%) ⬇️
...naming/RangeEquallyDivideBundleSplitAlgorithm.java 0.00% <0.00%> (-100.00%) ⬇️
...e/pulsar/broker/admin/impl/ResourceQuotasBase.java 0.00% <0.00%> (-96.43%) ⬇️
...he/pulsar/broker/service/AnalyzeBacklogResult.java 0.00% <0.00%> (-92.31%) ⬇️
.../apache/pulsar/broker/admin/v1/ResourceQuotas.java 0.00% <0.00%> (-91.43%) ⬇️
...e/pulsar/broker/stats/AllocatorStatsGenerator.java 0.00% <0.00%> (-91.38%) ⬇️
... and 244 more

@Jason918
Copy link
Contributor

When using pulsar-admin and encountering an exception, first check the body, then check the http text

Can you give an actual case this PR is solving?

@tuteng
Copy link
Member Author

tuteng commented Dec 15, 2022

When using pulsar-admin and encountering an exception, first check the body, then check the http text

Can you give an actual case this PR is solving?

https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/web/ExceptionHandler.java#L46

This needs an interceptor and then throws an exception with a custom message, using pulsar-admin to execute the corresponding command, which never gets the custom message @Jason918

@tuteng tuteng merged commit 1107af2 into apache:master Dec 15, 2022
@mattisonchao
Copy link
Member

Oops. Could you help to take a look? I am not sure if it is a sensitive breaking change for users.

@codelipenghui @eolivelli @Technoboy- @Jason918

lifepuzzlefun pushed a commit to lifepuzzlefun/pulsar that referenced this pull request Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli area/client doc-not-needed Your PR changes do not impact docs ready-to-test type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants