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 web application exception to redirect request #9228

Merged
merged 3 commits into from
Jan 19, 2021

Conversation

sijie
Copy link
Member

@sijie sijie commented Jan 18, 2021

Motivation

validateNamespaceBundleOwnership throws a web application exception with Response.temporaryRedirect(redirect)
to redirect the request to the owner broker. But the web application exception is a runtime exception. If you don't
handle and propagate it correctly, it will cause web request to be hang.

PR #8746 changed some web calls to async but it doesn't handle the web application exception. It causes topics list
with non-persistent topics to be hang.

This pull request make sure the callers of validateNamespaceBundleOwnership catch and propagate the exceptions to
web response.

*Motivation*

`validateNamespaceBundleOwnership` throws a web application exception with `Response.temporaryRedirect(redirect)`
to redirect the request to the owner broker. But the web application exception is a runtime exception. If you don't
handle and propagate it correctly, it will cause web request to be hang.

PR apache#8746 changed some web calls to async but it doesn't handle the web application exception. It causes `topics list`
with non-persistent topics to be hang.

This pull request make sure the callers of `validateNamespaceBundleOwnership` catch and propagate the exceptions to
web response.
@sijie sijie added this to the 2.8.0 milestone Jan 18, 2021
@sijie sijie self-assigned this Jan 18, 2021
Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

LGTM

@jiazhai
Copy link
Member

jiazhai commented Jan 18, 2021

/pulsarbot run-failure-checks

2 similar comments
@freeznet
Copy link
Contributor

/pulsarbot run-failure-checks

@freeznet
Copy link
Contributor

/pulsarbot run-failure-checks

@sijie sijie assigned sijie and codelipenghui and unassigned sijie Jan 18, 2021
@jiazhai
Copy link
Member

jiazhai commented Jan 19, 2021

/pulsarbot run-failure-checks

1 similar comment
@freeznet
Copy link
Contributor

/pulsarbot run-failure-checks

@codelipenghui codelipenghui merged commit aaa27c3 into apache:master Jan 19, 2021
@sijie sijie deleted the topic_list_hang branch January 19, 2021 05:12
codelipenghui pushed a commit that referenced this pull request Jan 19, 2021
*Motivation*

`validateNamespaceBundleOwnership` throws a web application exception with `Response.temporaryRedirect(redirect)`
to redirect the request to the owner broker. But the web application exception is a runtime exception. If you don't
handle and propagate it correctly, it will cause web request to be hang.

PR #8746 changed some web calls to async but it doesn't handle the web application exception. It causes `topics list`
with non-persistent topics to be hang.

This pull request make sure the callers of `validateNamespaceBundleOwnership` catch and propagate the exceptions to
web response.

(cherry picked from commit aaa27c3)
@codelipenghui codelipenghui added the cherry-picked/branch-2.7 Archived: 2.7 is end of life label Jan 19, 2021
merlimat pushed a commit to merlimat/pulsar that referenced this pull request Apr 6, 2021
*Motivation*

`validateNamespaceBundleOwnership` throws a web application exception with `Response.temporaryRedirect(redirect)`
to redirect the request to the owner broker. But the web application exception is a runtime exception. If you don't
handle and propagate it correctly, it will cause web request to be hang.

PR apache#8746 changed some web calls to async but it doesn't handle the web application exception. It causes `topics list`
with non-persistent topics to be hang.

This pull request make sure the callers of `validateNamespaceBundleOwnership` catch and propagate the exceptions to
web response.
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

6 participants