tharani694 opened a new pull request, #35610:
URL: https://github.com/apache/superset/pull/35610

   <!---
   Please write the PR title following the conventions at 
https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   Currently, transient failures in async query tasks cause jobs to fail 
immediately, leading to a poor user experience in SQL Lab and Explore views. By 
adding retry logic, temporary network or DB issues are automatically retried, 
improving system reliability.
   
   This PR introduces retry logic to Superset’s backend Celery tasks that 
handle asynchronous queries. Currently, load_chart_data_into_cache and 
load_explore_json_into_cache fail immediately on transient errors like database 
operational errors or network timeouts. This PR enhances reliability by 
allowing automatic retries.
   
   ### Changes Made:
   Added retry logic to both tasks:
   - Retries on OperationalError, ConnectionError, Timeout
   - max_retries=3, retry_backoff=True, retry_backoff_max=60s
   
   Bind Celery tasks (bind=True) to access retry count (self.request.retries) 
for logging
   
   Preserved existing functionality:
   - Soft timeouts (SoftTimeLimitExceeded)
   - SupersetVizException handling
   - Cache creation and update logic
   
   Type annotations added for self to satisfy mypy and pre-commit
   No frontend or documentation changes included
   
   ### TESTING
   
   - Passed Python pre-commit hooks (except frontend hooks).
   - Verified cache update and async_query_manager updates work correctly.
   - To Manually test in a local Celery + Superset environment, simulated 
transient DB/network errors which retried task successfully.
   - Passed Type checks with mypy
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


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