public boolean inErrorState() {
        synchronized (stateLock) {
            return state.inErrorState();
        }
    }
Sets the state

@param newState New state
streams/src/main/java/org/apache/kafka/streams/processor/internals/GlobalStreamThread.java