Skip to content

Commit

Permalink
Fix potential bug getting stats and remove unnecessary error log (#10500
Browse files Browse the repository at this point in the history
)

Co-authored-by: Jerry Peng <jerryp@splunk.com>
  • Loading branch information
jerrypeng and Jerry Peng committed May 7, 2021
1 parent 37583f6 commit 40e3261
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,9 @@ public void initializeComplete() {

@Override
public void initializeFailed(ManagedLedgerException e) {
log.error("[{}] Failed to initialize managed ledger: {}", name, e.getMessage());
if (config.isCreateIfMissing()) {
log.error("[{}] Failed to initialize managed ledger: {}", name, e.getMessage());
}

// Clean the map if initialization fails
ledgers.remove(name, future);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ private void createPersistentTopic(final String topic, boolean createIfMissing,
return;
}

if (!checkMaxTopicsPerNamespace(topicName, 1, topicFuture)) {
if (createIfMissing && !checkMaxTopicsPerNamespace(topicName, 1, topicFuture)) {
return;
}

Expand Down

0 comments on commit 40e3261

Please sign in to comment.