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


##########
superset/tasks/async_queries.py:
##########
@@ -110,11 +123,24 @@ def load_chart_data_into_cache(
             async_query_manager.update_job(
                 job_metadata, async_query_manager.STATUS_ERROR, errors=errors
             )
+            attempt = self.request.retries + 1
+            logger.warning(
+                "Retrying load_chart_data_into_cache (attempt {%s}): {%s}", 
attempt, ex
+            )
             raise
 
 
-@celery_app.task(name="load_explore_json_into_cache", 
soft_time_limit=query_timeout)
+@celery_app.task(
+    name="load_chart_data_into_cache",
+    soft_time_limit=query_timeout,
+    bind=True,
+    autoretry_for=RETRYABLE_EXCEPTIONS,
+    retry_backoff=current_app.config.get("ASYNC_TASK_RETRY_BACKOFF", True),
+    retry_backoff_max=current_app.config.get("ASYNC_TASK_RETRY_BACKOFF_MAX", 
60),
+    max_retries=current_app.config.get("ASYNC_TASK_MAX_RETRIES", 3),
+)
 def load_explore_json_into_cache(  # pylint: disable=too-many-locals

Review Comment:
   ### Incorrect task name in decorator <sub>![category 
Functionality](https://img.shields.io/badge/Functionality-0284c7)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   The task decorator for load_explore_json_into_cache function has incorrect 
name parameter - it uses 'load_chart_data_into_cache' instead of 
'load_explore_json_into_cache'.
   
   
   ###### Why this matters
   This will cause task registration conflicts and routing issues, as both 
tasks will be registered with the same name, leading to unpredictable behavior 
when the task queue tries to execute the intended function.
   
   ###### Suggested change ∙ *Feature Preview*
   Change the name parameter in the task decorator to match the function name:
   
   ```python
   @celery_app.task(
       name="load_explore_json_into_cache",
       soft_time_limit=query_timeout,
       bind=True,
       autoretry_for=RETRYABLE_EXCEPTIONS,
       retry_backoff=current_app.config.get("ASYNC_TASK_RETRY_BACKOFF", True),
       retry_backoff_max=current_app.config.get("ASYNC_TASK_RETRY_BACKOFF_MAX", 
60),
       max_retries=current_app.config.get("ASYNC_TASK_MAX_RETRIES", 3),
   )
   ```
   
   
   ###### 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/2fa31801-ebca-4c75-a71f-fdfe4d7fd20e/upvote)
 
[![Incorrect](https://img.shields.io/badge/👎%20Incorrect-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/2fa31801-ebca-4c75-a71f-fdfe4d7fd20e?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/2fa31801-ebca-4c75-a71f-fdfe4d7fd20e?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/2fa31801-ebca-4c75-a71f-fdfe4d7fd20e?what_not_in_standard=true)
 
[![Other](https://img.shields.io/badge/👎%20Other-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/2fa31801-ebca-4c75-a71f-fdfe4d7fd20e)
   </details>
   
   <sub>
   
   💬 Looking for more details? Reply to this comment to chat with Korbit.
   </sub>
   
   <!--- korbi internal id:e65b99d1-6070-40dd-aea2-994db6ad9a1a -->
   
   
   [](e65b99d1-6070-40dd-aea2-994db6ad9a1a)



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