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] Avoid throwing RestException in BrokerService #20761

Merged
merged 2 commits into from
Jul 11, 2023
Merged

[fix][broker] Avoid throwing RestException in BrokerService #20761

merged 2 commits into from
Jul 11, 2023

Conversation

liangyepianzhou
Copy link
Contributor

@liangyepianzhou liangyepianzhou commented Jul 8, 2023

Motivation

The BrokerService should not throw RestException, as the method is not only called by the admin tool. When a topic is auto-created during the creation of a consumer/producer and exceeds the maximum number of topics allowed in the namespace, returning a RestException (UnknownError received by the client) would be considered a retryable error.

Modification

To address this issue, the BrokerService will now return a NotAllowException instead of a RestException when the topic count exceeds the maximum limit allowed in the namespace.

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
  • The metrics
  • Anything that affects deployment

Documentation

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

Matching PR in forked repository

PR in forked repository:

## Motivation
We should not return RestException in BrokerService, because the method isn't only called by admin tool.
[Fix][Broker] Avoid throwing RestException in BrokerService
## Motivation
The BrokerService should not throw RestException, as the method is not only called by the admin tool. When a topic is auto-created during the creation of a consumer/producer and exceeds the maximum number of topics allowed in the namespace, returning a RestException (UnknownError received by the client) would be considered a retriable error.
## Modification
To address this issue, the BrokerService will now return a NotAllowException instead of a RestException when the topic count exceeds the maximum limit allowed in the namespace.
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jul 8, 2023
@liangyepianzhou liangyepianzhou changed the title [fix][broker] Should not throw RestException in BrokerService [Fix][Broker] Avoid throwing RestException in BrokerService Jul 8, 2023
@congbobo184 congbobo184 added this to the 3.1.0 milestone Jul 10, 2023
@Technoboy- Technoboy- changed the title [Fix][Broker] Avoid throwing RestException in BrokerService [fix][broker] Avoid throwing RestException in BrokerService Jul 10, 2023
@Technoboy- Technoboy- closed this Jul 10, 2023
@Technoboy- Technoboy- reopened this Jul 10, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #20761 (bee0698) into master (3a9fca9) will increase coverage by 0.11%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #20761      +/-   ##
============================================
+ Coverage     73.02%   73.14%   +0.11%     
- Complexity    32101    32130      +29     
============================================
  Files          1866     1866              
  Lines        138976   139028      +52     
  Branches      15291    15294       +3     
============================================
+ Hits         101485   101687     +202     
+ Misses        29463    29268     -195     
- Partials       8028     8073      +45     
Flag Coverage Δ
inttests 24.15% <ø> (?)
systests 25.08% <ø> (+0.16%) ⬆️
unittests 72.41% <ø> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...rg/apache/pulsar/broker/service/BrokerService.java 81.77% <ø> (+0.31%) ⬆️

... and 103 files with indirect coverage changes

@congbobo184 congbobo184 merged commit ebcd316 into apache:master Jul 11, 2023
@liangyepianzhou liangyepianzhou deleted the xiangying/RestException branch July 11, 2023 08:51
Technoboy- pushed a commit that referenced this pull request Jul 17, 2023
The BrokerService should not throw RestException, as the method is not only called by the admin tool. When a topic is auto-created during the creation of a consumer/producer and exceeds the maximum number of topics allowed in the namespace, returning a RestException (UnknownError received by the client) would be considered a retryable error.
To address this issue, the BrokerService will now return a NotAllowException instead of a RestException when the topic count exceeds the maximum limit allowed in the namespace.
Technoboy- pushed a commit that referenced this pull request Aug 17, 2023
## Motivation
The BrokerService should not throw RestException, as the method is not only called by the admin tool. When a topic is auto-created during the creation of a consumer/producer and exceeds the maximum number of topics allowed in the namespace, returning a RestException (UnknownError received by the client) would be considered a retryable error. 
## Modification
To address this issue, the BrokerService will now return a NotAllowException instead of a RestException when the topic count exceeds the maximum limit allowed in the namespace.
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.

4 participants