You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "kfaraz (via GitHub)" <gi...@apache.org> on 2026/03/10 08:43:40 UTC
Re: [PR] Make BrokerDynamicConfig backwards-compatible (druid)
kfaraz commented on code in PR #19120:
URL: https://github.com/apache/druid/pull/19120#discussion_r2910209247
##########
server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientImpl.java:
##########
@@ -257,16 +259,23 @@ public ListenableFuture<CoordinatorDynamicConfig> getCoordinatorDynamicConfig()
@Override
public ListenableFuture<BrokerDynamicConfig> getBrokerDynamicConfig()
{
- return FutureUtils.transform(
- client.asyncRequest(
- new RequestBuilder(HttpMethod.GET, "/druid/coordinator/v1/broker/config"),
- new BytesFullResponseHandler()
+ // Older coordinators may not support this endpoint; fall back to an empty config on 404.
+ return Futures.catching(
+ FutureUtils.transform(
+ client.asyncRequest(
+ new RequestBuilder(HttpMethod.GET, "/druid/coordinator/v1/broker/config"),
+ new BytesFullResponseHandler()
+ ),
+ holder -> JacksonUtils.readValue(jsonMapper, holder.getContent(), BrokerDynamicConfig.class)
),
- holder -> JacksonUtils.readValue(
- jsonMapper,
- holder.getContent(),
- BrokerDynamicConfig.class
- )
+ HttpResponseException.class,
+ e -> {
+ if (e != null && e.getResponse().getStatus().getCode() == 404) {
+ return BrokerDynamicConfig.builder().build();
+ }
+ throw new RuntimeException(e);
Review Comment:
Maybe just propagate the original exception instead of wrapping it in another `RuntimeException`.
--
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@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org