Skip to content

[fix][broker]Update interceptor handler exception - #18940

Merged
tuteng merged 6 commits into
apache:masterfrom
AmateurEvents:fixed/update-interceptor-handler-exception
Dec 19, 2022
Merged

tuteng merged 6 commits into
apache:masterfrom
AmateurEvents:fixed/update-interceptor-handler-exception

Conversation

@tuteng

@tuteng tuteng commented Dec 15, 2022 •

Copy link
Copy Markdown
Member

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

@codelipenghui codelipenghui left a comment

Copy link
Copy Markdown
Contributor

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

tuteng commented Dec 18, 2022

Copy link
Copy Markdown
Member Author

Is it possible to add a test to avoid regression?

Thanks, fixed, PTAL

@tuteng

tuteng commented Dec 19, 2022

Copy link
Copy Markdown
Member Author

@codecov-commenter

codecov-commenter commented Dec 19, 2022 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.51%. Comparing base (050b310) to head (3b1963f).
⚠️ Report is 3115 commits behind head on master.

Files with missing lines Patch % Lines
...org/apache/pulsar/broker/web/ExceptionHandler.java 0.00% 12 Missing ⚠️
Additional details and impacted files

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% <0.00%> (-0.84%) ⬇️

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

Files with missing lines Coverage Δ
...org/apache/pulsar/broker/web/ExceptionHandler.java 0.00% <0.00%> (ø)

... and 126 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@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