public Error resolveServiceAddress(RoutingNode recipient, String serviceName) {
        RPCServiceAddress ret = servicePool.resolve(serviceName, getMirror());
        if (ret == null) {
            return new Error(ErrorCode.NO_ADDRESS_FOR_SERVICE,
                             String.format("The address of service '%s' could not be resolved. It is not currently " +
                                           "registered with the Vespa name server. " +
                                           "The service must be having problems, or the routing configuration is wrong. " +
                                           "Address resolution attempted from host '%s'", serviceName, identity.getHostname()));
        }
        RPCTarget target = targetPool.getTarget(orb, ret);
        if (target == null) {
            return new Error(ErrorCode.CONNECTION_ERROR,
                             String.format("Failed to connect to service '%s' from host '%s'.",
                                           serviceName, identity.getHostname()));
        }
        ret.setTarget(target); // free by freeServiceAddress()
        recipient.setServiceAddress(ret);
        return null; // no error
    }
Resolves and assigns a service address for the given recipient using the given address. This is called by the
{@link #allocServiceAddress(RoutingNode)} method. The target allocated here is released when the routing node
calls {@link #freeServiceAddress(RoutingNode)}.

@param recipient   the recipient to assign the service address to
@param serviceName the name of the service to resolve
@return any error encountered, or null
messagebus/src/main/java/com/yahoo/messagebus/network/rpc/RPCNetwork.java