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] [admin] Make response code to 400 instead of 500 when delete topic fails due to enabled geo-replication #19879
[fix] [admin] Make response code to 400 instead of 500 when delete topic fails due to enabled geo-replication #19879
Conversation
…pic fails due to enabled geo-replication
I think 422 is better. |
Good idea. Already changed the response code to |
@@ -1106,7 +1106,9 @@ public void deleteTopic( | |||
ex = new RestException(Response.Status.PRECONDITION_FAILED, | |||
t.getMessage()); | |||
} | |||
if (isManagedLedgerNotFoundException(t)) { | |||
if (t instanceof IllegalStateException){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, the common exception IllegalStateException
is not good here. we can't identify what happened here. maybe we can improve it in the future?
@poorbarcode Should we cherry-pick it to previous branches? |
/pulsarbot rerun-failure-checks |
…pic fails due to enabled geo-replication (#19879) Motivation: As expected, If geo-replication is enabled, a topic cannot be deleted. However deleting that topic returns a 500, and no further info. Modifications: Make response code to 400 instead of 500 when delete topic fails due to enabled geo-replication (cherry picked from commit a903733)
…pic fails due to enabled geo-replication (#19879) Motivation: As expected, If geo-replication is enabled, a topic cannot be deleted. However deleting that topic returns a 500, and no further info. Modifications: Make response code to 400 instead of 500 when delete topic fails due to enabled geo-replication (cherry picked from commit a903733)
…pic fails due to enabled geo-replication (#19879) Motivation: As expected, If geo-replication is enabled, a topic cannot be deleted. However deleting that topic returns a 500, and no further info. Modifications: Make response code to 400 instead of 500 when delete topic fails due to enabled geo-replication (cherry picked from commit a903733)
…pic fails due to enabled geo-replication (#19879) Motivation: As expected, If geo-replication is enabled, a topic cannot be deleted. However deleting that topic returns a 500, and no further info. Modifications: Make response code to 400 instead of 500 when delete topic fails due to enabled geo-replication (cherry picked from commit a903733)
…pic fails due to enabled geo-replication (#19879) Motivation: As expected, If geo-replication is enabled, a topic cannot be deleted. However deleting that topic returns a 500, and no further info. Modifications: Make response code to 400 instead of 500 when delete topic fails due to enabled geo-replication (cherry picked from commit a903733)
…pic fails due to enabled geo-replication (apache#19879) Motivation: As expected, If geo-replication is enabled, a topic cannot be deleted. However deleting that topic returns a 500, and no further info. Modifications: Make response code to 400 instead of 500 when delete topic fails due to enabled geo-replication (cherry picked from commit a903733) (cherry picked from commit db6a59b)
Motivation
As expected, If geo-replication is enabled, a topic cannot be deleted. However deleting that topic returns a 500, and no further info.
In this case, we should give an error of 400 instead of 500.
Modifications
Make response code to 400 instead of 500 when delete topic fails due to enabled geo-replication
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: