and stop within function timeout. @retry( wait=wait_random_exponential(), stop=stop_after_delay(15) ) def _put_record(record): '''Write record to DDB''' try: DDT.put_item( TableName=DDB_TABLE_NAME, Item=ride_record ) except Exception as e: _logger.exception(e) raise e