private Node failOrMark(Node node, Agent agent, String reason, Mutex lock) {
        if (node.state() == Node.State.active) {
            node = node.withWantToFail(agent, clock.instant(), reason);
            write(node, lock);
            return node;
        } else {
            return move(node.hostname(), Node.State.failed, agent, false, Optional.of(reason), lock);
        }
    }
Fails all the nodes that are children of hostname before finally failing the hostname itself.
Non-active nodes are failed immediately, while active nodes are marked as wantToFail.
The host is failed if it has no active nodes and marked wantToFail if it has.

@return all the nodes that were changed by this request
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/Nodes.java