Skip to content

Commit 0eb3c04

Browse files
committed
address comment
1 parent cb9007b commit 0eb3c04

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Diff for: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarMetadataEventSynchronizer.java

+8-6
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ private void startProducer() {
156156
State stateTransient = state;
157157
log.info("[{}] Closing the new producer because the synchronizer state is {}", prod,
158158
stateTransient);
159-
CompletableFuture closeProducer = new CompletableFuture<>();
160-
closeResource(() -> prod.closeAsync(), closeProducer);
159+
CompletableFuture<Void> closeProducer = new CompletableFuture<>();
160+
closeResource(prod::closeAsync, closeProducer);
161161
closeProducer.thenRun(() -> {
162162
log.info("[{}] Closed the new producer because the synchronizer state is {}", prod,
163163
stateTransient);
@@ -221,11 +221,13 @@ private void startConsumer() {
221221
log.info("successfully created consumer {}", topicName);
222222
} else {
223223
State stateTransient = state;
224-
log.info("[{}] Closing the new consumer because the synchronizer state is {}", stateTransient);
225-
CompletableFuture closeConsumer = new CompletableFuture<>();
226-
closeResource(() -> consumer.closeAsync(), closeConsumer);
224+
log.info("[{}] Closing the new consumer because the synchronizer state is {}", topicName,
225+
stateTransient);
226+
CompletableFuture<Void> closeConsumer = new CompletableFuture<>();
227+
closeResource(consumer::closeAsync, closeConsumer);
227228
closeConsumer.thenRun(() -> {
228-
log.info("[{}] Closed the new consumer because the synchronizer state is {}", stateTransient);
229+
log.info("[{}] Closed the new consumer because the synchronizer state is {}", topicName,
230+
stateTransient);
229231
});
230232
}
231233
}).exceptionally(ex -> {

0 commit comments

Comments
 (0)