poorbarcode opened a new pull request, #22580: URL: https://github.com/apache/pulsar/pull/22580
### Motivation 1. The test `BrokerServiceTest.testBrokerStatsTopicLoadFailed` always fails, so https://github.com/apache/pulsar/pull/20494 disabled it. 2. There is a case that `pulsar_topic_load_failed_count` does not increase when load non-persistent topic fails<sup>[1]</sup>. **[1]**: https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java#L1239-L1258 ```java CompletableFuture<Optional<Topic>> topicFuture = new CompletableFuture<>(); topicFuture.exceptionally(t -> { pulsarStats.recordTopicLoadFailed(); return null; }); try { nonPersistentTopic = newTopic(topic, null, this, NonPersistentTopic.class); } catch (Throwable e) { log.warn("Failed to create topic {}", topic, e); // Highlight: It is a new future, so the event `topicFuture.exceptionally` will not receive the error callback anymore. return FutureUtil.failedFuture(e); } ``` ### Modifications 1. fix the test. 2. fix the issue ### Documentation <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. --> - [ ] `doc` <!-- Your PR contains doc changes. --> - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later --> - [x] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-complete` <!-- Docs have been already added --> ### Matching PR in forked repository PR in forked repository: x -- 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]
