-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[improve] [broker] Do not print an Error log when responding to HTTP-404
when calling Admin API
and the topic does not exist.
#21995
[improve] [broker] Do not print an Error log when responding to HTTP-404
when calling Admin API
and the topic does not exist.
#21995
Conversation
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java
Outdated
Show resolved
Hide resolved
Also reported by #21848 |
HTTP-404
when calling Admin API
and the topic does not exist.
Since the improvement "Do not try to open ML when the topic meta does not exist and do not expect to create a new one", will change the behavior of Behavior changes of
|
…-404` when calling `Admin API` and the topic does not exist. (#21995)
@poorbarcode could you help to cherry-pick this PR to branch-3.0? I see conflicts. |
…-404` when calling `Admin API` and the topic does not exist. (apache#21995) (cherry picked from commit 5ab1c05)
… exist and do not expect to create a new one. apache#21995 (apache#22004) Co-authored-by: Jiwe Guo <technoboy@apache.org> (cherry picked from commit d18831f)
…-404` when calling `Admin API` and the topic does not exist. (apache#21995) (cherry picked from commit 5ab1c05)
… exist and do not expect to create a new one. apache#21995 (apache#22004) Co-authored-by: Jiwe Guo <technoboy@apache.org> (cherry picked from commit d18831f)
@heesung-sn I have cherry-picked to branch-3.0 |
@@ -4634,7 +4634,7 @@ protected void internalGetLastMessageId(AsyncResponse asyncResponse, boolean aut | |||
}); | |||
}).exceptionally(ex -> { | |||
// If the exception is not redirect exception we need to log it. | |||
if (!isRedirectException(ex)) { | |||
if (!isNot307And404Exception(ex)) { |
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.
it seems that this line only log the 307 and 404 exceptions. not(not 307 and not 404)
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.
Good pointer! Now the implementation is only not 307 | 404
(so far, seems broker will not throw other 30x
)
@@ -132,7 +132,7 @@ public void getInternalStats( | |||
}) | |||
.thenAccept(asyncResponse::resume) | |||
.exceptionally(ex -> { | |||
if (!isRedirectException(ex)) { | |||
if (!isNot307And404Exception(ex)) { |
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.
Looks like this line and all the others where !isRedirectException(ex)
has been replaced with !isNot307..
are wrong, as the new line should NOT have the negation exclamation mark any more.
Motivation
Pulsar printed an Error log when responding to
HTTP-404
when callingAdmin API
and the topic does not exist.The behavior is expected, so it should not print an error log.
Modifications
Error
log when responding toHttp-404
.Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: x