Repository navigation
Improve exception message when DruidLeaderClient doesn't find leader node - #14775
Conversation
| if (leader == null) { | ||
| throw new IOE("No known server"); | ||
| throw DruidException.forPersona(DruidException.Persona.ADMIN) | ||
| .ofCategory(DruidException.Category.NOT_FOUND) |
There was a problem hiding this comment.
it should be RUNTIME_FAILURE and not NOT_FOUND.
There was a problem hiding this comment.
I wasn't sure between the two. I also think RUNTIME_FAILURE is apt since the leader server wasn't set and hence couldn't be found due to some failure.
| throw DruidException.forPersona(DruidException.Persona.ADMIN) | ||
| .ofCategory(DruidException.Category.NOT_FOUND) | ||
| .build( | ||
| "No leader server found for NodeRole [%s] and leaderRequestPath [%s].", |
There was a problem hiding this comment.
NodeRole is a technical internal term. Instead, you can do something like below
"A leader node could not be found for [%s] service. check the logs of [%s] service to validate that service is healthy. ", nodeRole, nodeRole
| ); | ||
| } | ||
|
|
||
| private String getCurrentKnownLeader(final boolean cached) throws IOException |
There was a problem hiding this comment.
I am a bit hesitant of changing the type of exception here. Since callers might be catching this right now. Maybe keep it IOException for now and just change the error message.
There was a problem hiding this comment.
Yes, that makes sense. Let me just update the exception message.
|
there are test failures that need to be addressed. |
| "A leader node could not be found for [%s] service. Check logs to validate service health.", | ||
| nodeRoleToWatch |
There was a problem hiding this comment.
| "A leader node could not be found for [%s] service. Check logs to validate service health.", | |
| nodeRoleToWatch | |
| "A leader node could not be found for [%s] service. Check logs of service [%s] to confirm it is healthy.", | |
| nodeRoleToWatch, nodeRoleToWatch |
…node (apache#14775) The existing exception message No known server thrown in DruidLeaderClient is unhelpful.
The existing exception message
No known serverthrown inDruidLeaderClientis unhelpful.This pr updates the message to be informative and actionable.