Shawyeok commented on issue #24312: URL: https://github.com/apache/pulsar/issues/24312#issuecomment-2889470488
The `brokerId` is initialized after the BrokerService has started. https://github.com/apache/pulsar/blob/eccc6b647e9cb07a18901471de1b2f8fafa88417/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java#L940-L942 So there's a chance the broker could receive a metadata change event before `brokerId` is initialized. https://github.com/apache/pulsar/blob/eccc6b647e9cb07a18901471de1b2f8fafa88417/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java#L2535-L2539 To avoid this race condition, we could initialize the `brokerId` earlier in the startup process, Would you be interested in opening a PR to address this? @HGHNice -- 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: commits-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org