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][broker]Update interceptor handler exception #18940

Merged

Conversation

tuteng
Copy link
Member

@tuteng tuteng commented Dec 15, 2022

Fixes #xyz

Master Issue: #xyz

Motivation

The pulsar-admin client does not correctly handle error messages from the interceptor response. The interceptor response is a string, but the client tries to parse it as an errorData object

https://github.com/apache/pulsar/blob/master/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/BaseResource.java#L323

Modifications

Update the response to a json object, update the response to a json object, which shouldn't cause a breaking change. The client will get the error message from the previous reason-content to "{"reason": "reason-content"}"

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#32

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Dec 15, 2022
@tuteng tuteng self-assigned this Dec 15, 2022
Copy link
Contributor

@codelipenghui codelipenghui left a comment

Choose a reason for hiding this comment

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

Is it possible to add a test to avoid regression?

@codelipenghui codelipenghui added this to the 2.12.0 milestone Dec 17, 2022
@tuteng
Copy link
Member Author

tuteng commented Dec 18, 2022

Is it possible to add a test to avoid regression?

Thanks, fixed, PTAL

@tuteng
Copy link
Member Author

tuteng commented Dec 19, 2022

@codecov-commenter
Copy link

codecov-commenter commented Dec 19, 2022

Codecov Report

Merging #18940 (3b1963f) into master (050b310) will decrease coverage by 0.83%.
The diff coverage is 6.66%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #18940      +/-   ##
============================================
- Coverage     47.35%   46.51%   -0.84%     
- Complexity     9384    10470    +1086     
============================================
  Files           623      703      +80     
  Lines         59104    68856    +9752     
  Branches       6146     7386    +1240     
============================================
+ Hits          27987    32029    +4042     
- Misses        28100    33221    +5121     
- Partials       3017     3606     +589     
Flag Coverage Δ
unittests 46.51% <6.66%> (-0.84%) ⬇️

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

Impacted Files Coverage Δ
...va/org/apache/pulsar/broker/service/ServerCnx.java 47.89% <0.00%> (-0.66%) ⬇️
...org/apache/pulsar/broker/web/ExceptionHandler.java 0.00% <0.00%> (ø)
.../pulsar/broker/service/persistent/SystemTopic.java 92.30% <100.00%> (+0.64%) ⬆️
.../apache/pulsar/broker/loadbalance/LoadManager.java 61.11% <0.00%> (-16.67%) ⬇️
...e/pulsar/broker/service/EntryBatchIndexesAcks.java 82.14% <0.00%> (-10.72%) ⬇️
...he/pulsar/client/impl/PartitionedProducerImpl.java 30.34% <0.00%> (-5.13%) ⬇️
...tent/PersistentDispatcherSingleActiveConsumer.java 54.85% <0.00%> (-4.39%) ⬇️
...rg/apache/pulsar/broker/service/AbstractTopic.java 61.91% <0.00%> (-3.30%) ⬇️
...er/impl/SingleSnapshotAbortedTxnProcessorImpl.java 70.65% <0.00%> (-3.16%) ⬇️
...pulsar/broker/service/PulsarCommandSenderImpl.java 73.84% <0.00%> (-3.08%) ⬇️
... and 120 more

@tuteng tuteng merged commit e07b67f into apache:master Dec 19, 2022
tuteng added a commit that referenced this pull request Dec 19, 2022
tuteng added a commit that referenced this pull request Dec 19, 2022
tuteng added a commit that referenced this pull request Dec 19, 2022
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jan 10, 2023
(cherry picked from commit e07b67f)
(cherry picked from commit ad9c133)
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jan 11, 2023
(cherry picked from commit e07b67f)
(cherry picked from commit ad9c133)
@coderzc coderzc added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants