private void notifyAbort(String msg) {
        Deque<RoutingNode> stack = new ArrayDeque<>();
        stack.push(this);
        while (!stack.isEmpty()) {
            RoutingNode node = stack.pop();
            if (!node.isActive) {
                // reply not pending
            } else if (node.reply != null) {
                node.notifyParent();
            } else if (node.children.isEmpty()) {
                node.setError(ErrorCode.SEND_ABORTED, msg);
                node.notifyParent();
            } else {
                for (RoutingNode child : node.children) {
                    stack.push(child);
                }
            }
        }
    }
This method assigns an error reply to all unsent leaf nodes, and invokes {@link #notifyParent()} on them. This
has the effect of ensuring that a reply will return to sender.

@param msg The error message to assign.
messagebus/src/main/java/com/yahoo/messagebus/routing/RoutingNode.java