mirror of https://github.com/apache/druid.git
Improve exception message when DruidLeaderClient doesn't find leader node (#14775)
The existing exception message No known server thrown in DruidLeaderClient is unhelpful.
This commit is contained in:
parent
c8537dbeaf
commit
4b9846b90f
|
@ -264,7 +264,11 @@ public class DruidLeaderClient
|
||||||
);
|
);
|
||||||
|
|
||||||
if (leader == null) {
|
if (leader == null) {
|
||||||
throw new IOE("No known server");
|
throw new IOE(
|
||||||
|
"A leader node could not be found for [%s] service. "
|
||||||
|
+ "Check logs of service [%s] to confirm it is healthy.",
|
||||||
|
nodeRoleToWatch, nodeRoleToWatch
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
return leader;
|
return leader;
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,7 +159,9 @@ public class DruidLeaderClientTest extends BaseJettyTest
|
||||||
druidLeaderClient.start();
|
druidLeaderClient.start();
|
||||||
|
|
||||||
expectedException.expect(IOException.class);
|
expectedException.expect(IOException.class);
|
||||||
expectedException.expectMessage("No known server");
|
expectedException.expectMessage(
|
||||||
|
"A leader node could not be found for [PEON] service. "
|
||||||
|
+ "Check logs of service [PEON] to confirm it is healthy.");
|
||||||
druidLeaderClient.makeRequest(HttpMethod.POST, "/simple/direct");
|
druidLeaderClient.makeRequest(HttpMethod.POST, "/simple/direct");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue