Skip to content

Commit

Permalink
[fix][broker] fix logging with correct error message while loading th…
Browse files Browse the repository at this point in the history
…e topic (#23544)

(cherry picked from commit ce0c1bb)
  • Loading branch information
rdhabalia authored and lhotari committed Nov 13, 2024
1 parent 5e547a2 commit c62510a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1815,7 +1815,10 @@ public void openLedgerFailed(ManagedLedgerException exception, Object ctx) {
}, () -> isTopicNsOwnedByBrokerAsync(topicName), null);

}).exceptionally((exception) -> {
log.warn("[{}] Failed to get topic configuration: {}", topic, exception.getMessage(), exception);
boolean migrationFailure = exception.getCause() instanceof TopicMigratedException;
String msg = migrationFailure ? "Topic is already migrated" :
"Failed to get topic configuration:";
log.warn("[{}] {} {}", topic, msg, exception.getMessage(), exception);
// remove topic from topics-map in different thread to avoid possible deadlock if
// createPersistentTopic-thread only tries to handle this future-result
pulsar.getExecutor().execute(() -> topics.remove(topic, topicFuture));
Expand Down

0 comments on commit c62510a

Please sign in to comment.