private void updateStateUnlessAlreadyFailed(StateDescription newState) {
        if (!state.failed()) {
            state = newState;
        } // else: don't override existing failure state
    }
We also have to explicitly keep track of how many messages we are processing
locally, as these may be asynchronous. We cannot invoke the control handler's
onDone() method until we have drained all such messages.
documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusVisitorSession.java