Repository navigation
[improve][client]When namespace is deleted, the client is constantly reconnecting - #18194
Conversation
michaeljmarshall
left a comment
There was a problem hiding this comment.
The technical change looks good to me. I think we might want to clean up the annotations before merging, though.
| @ApiOperation(value = "Set entry filters for specified topic") | ||
| @ApiResponses(value = {@ApiResponse(code = 403, message = "Don't have admin permission"), | ||
| @ApiResponse(code = 404, message = "Topic does not exist"), | ||
| @ApiResponse(code = 404, message = "Tenant or namespace or topic doesn't exist"), |
There was a problem hiding this comment.
Is there a reason this string has Tenant, but most of the others do not?
There was a problem hiding this comment.
Already fixed. Could you take a look again?
There was a problem hiding this comment.
I don't think this was fixed. Why do we have tenant in this annotation but not in the annotation on line 192 above?
Technoboy-
left a comment
There was a problem hiding this comment.
LGTM, please fix @michaeljmarshall suggestion.
b01f29a to
a222926
Compare
|
rebase master |
| if (throwable instanceof RestException restException){ | ||
| throw restException; |
There was a problem hiding this comment.
We can remove these lines.
The RestException is a sub-class of WebApplicationException
| String msg = String.format("Namespace %s is deleted", namespace.toString()); | ||
| log.warn(msg); | ||
| validationFuture.completeExceptionally(new RestException(Status.PRECONDITION_FAILED, | ||
| validationFuture.completeExceptionally(new RestException(Status.NOT_FOUND, |
There was a problem hiding this comment.
It's incorrect here.
If allowDeletedNamespace is false. We should return Status.PRECONDITION_FAILED. No matter if policies.deleted is true or false.
There was a problem hiding this comment.
If we return Status.PRECONDITION_FAILED here, the error code will same as the scenario if (policies.replication_clusters.isEmpty(), then we can not determine whether the error was caused by namespace deleted when calling this method
There was a problem hiding this comment.
Oh, got it. I misunderstand the allowDeletedNamespace. I thought it was forceDeleteNamespaceAllowed=false in broker.conf.
Codecov Report
@@ Coverage Diff @@
## master #18194 +/- ##
============================================
- Coverage 34.91% 27.89% -7.02%
+ Complexity 5707 3695 -2012
============================================
Files 607 398 -209
Lines 53396 43561 -9835
Branches 5712 4478 -1234
============================================
- Hits 18644 12153 -6491
+ Misses 32119 29511 -2608
+ Partials 2633 1897 -736
Flags with carried forward coverage won't be shown. Click here to find out more.
|
9fd0426 to
3f7179e
Compare
|
/pulsarbot rerun-failure-checks |
…reconnecting (apache#18194) (cherry picked from commit 8f8637a) Signed-off-by: Zixuan Liu <[email protected]>
…reconnecting (apache#18194) (cherry picked from commit 8f8637a) Signed-off-by: Zixuan Liu <[email protected]>
Motivation
If the namespace is deleted, the
cmd-lookupwill still keep retrying, because the error code sent to the client isMetadataError, and the client will retry when it getsMetadataError. No matter how many times it tries again, it will not succeed.pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/lookup/TopicLookupBase.java
Lines 250 to 257 in 6cc30c9
Modifications
If the namespace is deleted
cmd-lookupwill get the error codeTopicNotFound404API topicsandAPI namespacesTODOI will write a test laterDocumentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: