Hm, does this still mean that we are retrying even in the last loop and raise the exception directly again? That is wasted time. I think the second if check should come first. Please raise a new issue for that if my observation is true.