Limit the number of retries and extend the timeout