sofa-jraft icon indicating copy to clipboard operation
sofa-jraft copied to clipboard

chore: remove duplicate address check

Open caicancai opened this issue 1 month ago • 2 comments

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.

caicancai avatar Jun 29 '24 07:06 caicancai