void prepareForRetry() {
        shouldRetry = false;
        reply = null;
        if (routingContext != null && routingContext.getSelectOnRetry()) {
            children.clear();
        } else if (!children.isEmpty()) {
            boolean retryingSome = false;
            for (RoutingNode child : children) {
                if (child.shouldRetry || child.reply == null) {
                    child.prepareForRetry();
                    retryingSome = true;
                }
            }
            if (!retryingSome) {
                // Entering here means we have no children that should be resent even though this node reports a transient
                // error. The only thing we can do is to reselect from this.
                children.clear();
            }
        }
    }
This method is used to reset the internal state of routing nodes that will be resent. If a routing policy sets
{@link RoutingContext#setSelectOnRetry(boolean)} to true, this method will reroute everything from that node
onwards. If that flag is not set, scheduling recurses into any child that got a reply with only transient errors.
Finally, if neither this node or none of its children were scheduled for resending, force reroute from this.
messagebus/src/main/java/com/yahoo/messagebus/routing/RoutingNode.java