gaoran10 commented on code in PR #19641:
URL: https://github.com/apache/pulsar/pull/19641#discussion_r1123098256
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/SnapshotSegmentAbortedTxnProcessorImpl.java:
##########
@@ -760,11 +763,13 @@ private CompletableFuture<Void>
clearAllSnapshotSegments() {
});
}
-
- CompletableFuture<Void> closeAsync() {
- return CompletableFuture.allOf(
-
this.snapshotIndexWriterFuture.thenCompose(SystemTopicClient.Writer::closeAsync),
-
this.snapshotSegmentsWriterFuture.thenCompose(SystemTopicClient.Writer::closeAsync));
+ synchronized CompletableFuture<Void> closeAsync() {
+ if (!closed) {
+ closed = true;
+ this.snapshotIndexWriterFuture.close();
+ this.snapshotSegmentsWriterFuture.close();
Review Comment:
This close method is used to release the reference count, I adjust logic to
close the writer in release method.
--
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]