korbit-ai[bot] commented on code in PR #36023:
URL: https://github.com/apache/superset/pull/36023#discussion_r2499241465


##########
superset/sql_lab.py:
##########
@@ -129,12 +129,11 @@ def handle_query_error(
 def get_query_backoff_handler(details: dict[Any, Any]) -> None:
     stats_logger = app.config["STATS_LOGGER"]
     query_id = details["kwargs"]["query_id"]
-    logger.error(
-        "Query with id `%s` could not be retrieved", str(query_id), 
exc_info=True
-    )
     stats_logger.incr(f"error_attempting_orm_query_{details['tries'] - 1}")
-    logger.error(
-        "Query %s: Sleeping for a sec before retrying...", str(query_id), 
exc_info=True
+    logger.warning(
+        "Query with id `%s` could not be retrieved, sleeping for a sec before 
retrying",
+        str(query_id),
+        exc_info=True,
     )

Review Comment:
   ### Misleading log message about sleep operation <sub>![category 
Functionality](https://img.shields.io/badge/Functionality-0284c7)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   The consolidated warning message claims to be "sleeping for a sec before 
retrying" but the actual sleep/retry logic is handled by the backoff decorator, 
not within this handler function.
   
   
   ###### Why this matters
   This creates misleading log messages that suggest the handler function is 
performing the sleep operation when it's actually just a callback that logs the 
retry attempt. This can confuse developers debugging retry behavior.
   
   ###### Suggested change ∙ *Feature Preview*
   Change the message to accurately reflect that this is a backoff handler 
logging a retry attempt:
   
   ```python
   logger.warning(
       "Query with id `%s` could not be retrieved, attempt %d of %d",
       str(query_id),
       details['tries'],
       5,  # max_tries from the backoff decorator
       exc_info=True,
   )
   ```
   
   
   ###### Provide feedback to improve future suggestions
   [![Nice 
Catch](https://img.shields.io/badge/👍%20Nice%20Catch-71BC78)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/7cd54c5d-7d2c-411b-b5ed-e563b5f2bec0/upvote)
 
[![Incorrect](https://img.shields.io/badge/👎%20Incorrect-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/7cd54c5d-7d2c-411b-b5ed-e563b5f2bec0?what_not_true=true)
  [![Not in 
Scope](https://img.shields.io/badge/👎%20Out%20of%20PR%20scope-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/7cd54c5d-7d2c-411b-b5ed-e563b5f2bec0?what_out_of_scope=true)
 [![Not in coding 
standard](https://img.shields.io/badge/👎%20Not%20in%20our%20standards-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/7cd54c5d-7d2c-411b-b5ed-e563b5f2bec0?what_not_in_standard=true)
 
[![Other](https://img.shields.io/badge/👎%20Other-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/7cd54c5d-7d2c-411b-b5ed-e563b5f2bec0)
   </details>
   
   <sub>
   
   💬 Looking for more details? Reply to this comment to chat with Korbit.
   </sub>
   
   <!--- korbi internal id:e5799792-0a91-4638-9023-f3e0816cd372 -->
   
   
   [](e5799792-0a91-4638-9023-f3e0816cd372)



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to