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

Handle NotAllowed Exception at the client side. #7430

Merged
merged 3 commits into from
Jul 17, 2020

Conversation

codelipenghui
Copy link
Contributor

Motivation

Handle NotAllowed Exception at the client-side. Currently, if disable the key_shared feature at the broker side, the client will get a UnknownError from the broker and then the client will reconnect again. The reasonable behavior is to return a specific exception to users and let the client stop reconnect.

Modifications

Add NotAllowedError in the ServerError

Verifying this change

testDisableKeySharedSubscription can cover this change.

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

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (yes)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

  • Does this pull request introduce a new feature? (no)

@codelipenghui codelipenghui self-assigned this Jul 2, 2020
@codelipenghui codelipenghui added this to the 2.7.0 milestone Jul 2, 2020
@jiazhai
Copy link
Member

jiazhai commented Jul 5, 2020

/pulsarbot run-failure-checks

@jiazhai
Copy link
Member

jiazhai commented Jul 7, 2020

/pulsarbot run-failure-checks

2 similar comments
@codelipenghui
Copy link
Contributor Author

/pulsarbot run-failure-checks

@sijie
Copy link
Member

sijie commented Jul 10, 2020

/pulsarbot run-failure-checks

@@ -196,6 +196,7 @@ enum ServerError {

TransactionCoordinatorNotFound = 20; // Transaction coordinator not found error
InvalidTxnStatus = 21; // Invalid txn status error
NotAllowedError = 22; // Not allowed error
Copy link
Member

Choose a reason for hiding this comment

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

From the ci error. we need to handle this new error type in ClientConnection.cc

@codelipenghui
Copy link
Contributor Author

/pulsarbot run-failure-checks

@codelipenghui
Copy link
Contributor Author

/pulsarbot run-failure-checks

1 similar comment
@codelipenghui
Copy link
Contributor Author

/pulsarbot run-failure-checks

@codelipenghui codelipenghui merged commit f8b2a23 into apache:master Jul 17, 2020
@codelipenghui codelipenghui deleted the penghui/handle_not_allowd branch July 17, 2020 01:22
codelipenghui added a commit to streamnative/pulsar-archived that referenced this pull request Jul 17, 2020
* Handle NotAllowed Exception at the client side.

(cherry picked from commit f8b2a23)
wolfstudy pushed a commit that referenced this pull request Jul 29, 2020
* Handle NotAllowed Exception at the client side.

(cherry picked from commit f8b2a23)
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Aug 24, 2020
* Handle NotAllowed Exception at the client side.
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.

None yet

4 participants