etr2460 commented on a change in pull request #8139: [sqllab] add retries for 
stop_query
URL: 
https://github.com/apache/incubator-superset/pull/8139#discussion_r320373575
 
 

 ##########
 File path: superset/sql_lab.py
 ##########
 @@ -70,23 +70,31 @@ def handle_query_error(msg, query, session, payload=None):
     return payload
 
 
-def get_query(query_id, session, retry_count=5):
-    """attemps to get the query and retry if it cannot"""
-    query = None
-    attempt = 0
-    while not query and attempt < retry_count:
-        try:
-            query = session.query(Query).filter_by(id=query_id).one()
-        except Exception:
-            attempt += 1
-            logging.error(f"Query with id `{query_id}` could not be retrieved")
-            stats_logger.incr("error_attempting_orm_query_" + str(attempt))
-            logging.error(f"Query {query_id}: Sleeping for a sec before 
retrying...")
-            sleep(1)
-    if not query:
-        stats_logger.incr("error_failed_at_getting_orm_query")
+def backoff_handler(details):
 
 Review comment:
   naming nit: I'd call this `get_query_backoff_handler` since this is only for 
that function specifically.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to