eolivelli commented on code in PR #18886:
URL: https://github.com/apache/pulsar/pull/18886#discussion_r1091922347
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java:
##########
@@ -890,6 +901,23 @@ public CompletableFuture<Void> close() {
}
}
+ protected void retryClose() {
+ ScheduledExecutorService scheduler =
topic.getBrokerService().pulsar().getExecutor();
+ scheduler.schedule(() -> {
+ close()
+ .thenAccept(unused -> {
+ if (log.isDebugEnabled()) {
+ log.debug("Close subscription {} finished.",
subName);
+ }
+ })
+ .exceptionally(t -> {
+ log.warn("Close subscription {} failed.", subName, t);
+ retryClose();
+ return null;
+ });
+ }, 20, TimeUnit.SECONDS);
Review Comment:
20 seconds ?
Probably we have to log at WARN level something like
log.warn("Re-scheduling closing of subscription {} in 20 seconds")
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]