sofa-jraft
sofa-jraft copied to clipboard
chore: remove duplicate address check
Motivation:
In NodeImpl, the address is checked at the beginning. I don't think it needs to be checked again later.
if (this.serverId.getIp().equals(Utils.IP_ANY)) {
LOG.error("Node can't started from IP_ANY.");
return false;
}
if (!NodeManager.getInstance().serverExists(this.serverId.getEndpoint())) {
LOG.error("No RPC server attached to, did you forget to call addService?");
return false;
}
Modification:
Describe the idea and modifications you've done.
Result:
Fixes #<GitHub issue number>.
If there is no issue then describe the changes introduced by this PR.
Summary by CodeRabbit
-
Refactor
- Streamlined node addition process for improved performance by removing unnecessary server existence check.