Incorporate changes in max_retry logic.