Update retry_with_logging to work with new retry semantics.