introduce maxFailuresBeforePause etc.