Skip to content

Handle web application exception to redirect request - #9228

Merged
codelipenghui merged 3 commits into
apache:masterfrom
sijie:topic_list_hang
Jan 19, 2021
Merged

codelipenghui merged 3 commits into
apache:masterfrom
sijie:topic_list_hang

Conversation

@sijie

@sijie sijie commented Jan 18, 2021

Copy link
Copy Markdown
Member

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

@eolivelli eolivelli 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.

LGTM

@jiazhai

jiazhai commented Jan 18, 2021

Copy link
Copy Markdown
Member

/pulsarbot run-failure-checks

2 similar comments
@freeznet

Copy link
Copy Markdown
Contributor

/pulsarbot run-failure-checks

@freeznet

Copy link
Copy Markdown
Contributor

/pulsarbot run-failure-checks

@sijie sijie assigned sijie and codelipenghui and unassigned sijie Jan 18, 2021
@jiazhai

jiazhai commented Jan 19, 2021

Copy link
Copy Markdown
Member

/pulsarbot run-failure-checks

1 similar comment
@freeznet

Copy link
Copy Markdown
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.

6 participants