could this fail if a task switches back and forth between max and no max retries?  i understand we're trying to do some accounting here, can you explain the logic?  Is the intended behavior supposed to be there will only ever be settings.MAX_RETRIES (sic) retries total for all capped retry errors?