Skip to content

Commit

Permalink
Remove readerCaches and close reader when exception occurs in SystemT…
Browse files Browse the repository at this point in the history
…opicBasedTopicPoliciesService. (apache#12873)
  • Loading branch information
Technoboy- authored and fangxiaobing committed Dec 19, 2021
1 parent 6d9bb3a commit d0b0be3
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ private void prepareInitPoliciesCache(NamespaceName namespace, CompletableFuture
if (ex != null) {
log.error("[{}] Failed to create reader on __change_events topic", namespace, ex);
result.completeExceptionally(ex);
readerCaches.remove(namespace);
reader.closeAsync();
} else {
initPolicesCache(reader, result);
result.thenRun(() -> readMorePolicies(reader));
Expand Down

0 comments on commit d0b0be3

Please sign in to comment.