poorbarcode commented on code in PR #17524:
URL: https://github.com/apache/pulsar/pull/17524#discussion_r1447316514
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -1479,6 +1486,10 @@ public void deleteLedgerComplete(Object ctx) {
unfenceTopicToResume();
}
});
+
+ FutureUtil.completeAs(closeWithoutWaitingClientFuture, res);
+ FutureUtil.completeAs(fullyCloseFuture, res);
Review Comment:
> What's the difference between `closeWithoutWaitingClientFuture` and
`fullyCloseFuture`? Is it the same in this case?
We use `closeWithoutWaitingClientFuture` and `fullyCloseFuture` to prevent a
new closing if there is an in-progress deletion or closing. We make Pulsar
return the in-progress one when it is called the second time.
### Topic close
- `PersistentTopic.close(false /* closeWithoutWaitingClientDisconnect */)`
will be executed directly; do not wait for the clients to be disconnected.
- `PersistentTopic.close(true /* closeWithoutWaitingClientDisconnect */)`
will be executed after the clients disconnected.
If the first one closing is called by `PersistentTopic.delete(false /*
closeWithoutWaitingClientDisconnect */)`, the both
`closeWithoutWaitingClientFuture` and `fullyCloseFuture` will be initialized as
"waiting for clients disconnect" .
If the first one closing is called by `PersistentTopic.delete(true /*
closeWithoutWaitingClientDisconnect */)`, `fullyCloseFuture` will be
initialized as "waiting for clients disconnect"; and
`closeWithoutWaitingClientFuture` will be initialized as "not waiting for
clients disconnect" .
### Topic delete
- `PersistentTopic.delete(false /* closeIfClientsConnected */)` will fail
when some clients are connected.
- `PersistentTopic.delete(true /* closeIfClientsConnected */)` will be
executed after the clients disconnected.
the both of `closeWithoutWaitingClientFuture` and `fullyCloseFuture` will be
initialized as "waiting for clients disconnect" .
--
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]