poorbarcode commented on code in PR #21946: URL: https://github.com/apache/pulsar/pull/21946#discussion_r1536603456
########## pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractReplicator.java: ########## @@ -188,58 +274,134 @@ protected CompletableFuture<Boolean> isLocalTopicActive() { }, brokerService.executor()); } - protected synchronized CompletableFuture<Void> closeProducerAsync() { - if (producer == null) { - STATE_UPDATER.set(this, State.Stopped); + /** + * @Deprecated This method only be used by {@link PersistentTopic#checkGC} now. + * TODO "PersistentReplicator.replicateEntries" may get a NullPointerException if this method and a + * "cursor.readComplete" execute concurrently. + */ + @Deprecated Review Comment: > I think we can left a TODO there to refactor the code. Removed todo these comments, and I left another TODO comment [here](https://github.com/apache/pulsar/pull/21946/files#diff-5edf14cc6f25857d0cfdd26b2d3b3141230ecfb0dfa95aebf7583fd76ede4c4bR2944-R2952) -- 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: commits-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org