lhotari commented on code in PR #17559:
URL: https://github.com/apache/pulsar/pull/17559#discussion_r966643646
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/systopic/TopicPoliciesSystemTopicClient.java:
##########
@@ -121,15 +121,17 @@ private String getEventKey(PulsarEvent event) {
@Override
public void close() throws IOException {
- this.producer.close();
- systemTopicClient.getWriters().remove(TopicPolicyWriter.this);
+ try {
+ closeAsync().get();
+ } catch (Exception e) {
+ throw new IOException(e);
Review Comment:
this seems wrong. I'd suggest something similar as what is used in
BrokerService.close:
https://github.com/apache/pulsar/blob/a7f1a5657782ff7ac91a89afdd49568d74d111f5/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java#L713-L721
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/systopic/TopicPoliciesSystemTopicClient.java:
##########
@@ -184,15 +186,17 @@ public CompletableFuture<Boolean> hasMoreEventsAsync() {
@Override
public void close() throws IOException {
- this.reader.close();
- systemTopic.getReaders().remove(TopicPolicyReader.this);
+ try {
+ closeAsync().get();
+ } catch (Exception e) {
+ throw new IOException(e);
+ }
Review Comment:
this seems wrong. I'd suggest something similar as what is used in
BrokerService.close:
https://github.com/apache/pulsar/blob/a7f1a5657782ff7ac91a89afdd49568d74d111f5/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java#L713-L721
--
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]