You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "mingmxu (via GitHub)" <gi...@apache.org> on 2023/06/23 06:42:53 UTC

[GitHub] [pinot] mingmxu opened a new issue, #10965: throw exception in `BaseBrokerStarter#getDefaultBrokerId()`

mingmxu opened a new issue, #10965:
URL: https://github.com/apache/pinot/issues/10965

   `brokerId` is assigned as below:([code](https://github.com/apache/pinot/blob/24c5d8fe8521b91e68dd07294a3f57b067c0d525/pinot-broker/src/main/java/org/apache/pinot/broker/broker/helix/BaseBrokerStarter.java#L280))
   ```
   String brokerId = _brokerConf.getProperty(Broker.CONFIG_OF_BROKER_ID, getDefaultBrokerId());
   ``` 
   
   A valid value for `brokerId` is important in many components, for example it's required in v2 engine to guarantee an unique requestId. It's preferred to throw an exception to stop broker starter instead of return an empty string.
   ```
     private String getDefaultBrokerId() {
       try {
         return InetAddress.getLocalHost().getHostName();
       } catch (Exception e) {
         LOGGER.error("Caught exception while getting default broker Id", e);
         return "";
       }
     }
   ```
   
   cc @jackjlli 


-- 
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-unsubscribe@pinot.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org