ganczarek opened a new issue, #24889:
URL: https://github.com/apache/superset/issues/24889

   When chart data is forced to refresh in chart view, query is executed in 
synchronous manner, even when `GLOBAL_ASYNC_QUERIES=True`.
   
   #### How to reproduce the bug
   
   1. Go to 'Chart'
   2. Click on 'Cached' to force refresh 
   
   ### Expected results
   
   Superset should:
   - request chart data (`POST /api/v1/chart/data?form_data=<fomr_data>`)
   - poll for results (`GET /api/v1/async_event/?last_id=<last_id>`)
   - get results  (`GET /api/v1/chart/data/<cache_key>`)
   
   ### Actual results
   
   Superset sends `POST /api/v1/chart/data` and waits for that request to 
return results.
   
   ### Environment
   
   - browser type and version: Chromium
   - superset version: `2.1.0`
   - python version: `3.8.13`
   - node.js version: `N/A`
   - any feature flags active: `GLOBAL_ASYNC_QUERIES=True`
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [x] I have checked the superset logs for python stacktraces and included 
it here as text if there are any.
   - [ ] I have reproduced the issue with at least the latest released version 
of superset.
   - [x] I have checked the issue tracker for the same issue and I haven't 
found one similar.
   
   ### Additional context
   
   The issue seems to be in `QueryCacheManager`. When query is forced it 
returns [query_cache object 
early](https://github.com/apache/superset/blob/554ef07eeda094f5bcc081e7a265e0b7408e0868/superset/common/utils/query_cache_manager.py#L149)
 and ignores [forced_cached flag 
check](https://github.com/apache/superset/blob/554ef07eeda094f5bcc081e7a265e0b7408e0868/superset/common/utils/query_cache_manager.py#L188).
 In result, it ends getting [query results 
immediately](https://github.com/apache/superset/blob/554ef07eeda094f5bcc081e7a265e0b7408e0868/superset/common/query_context_processor.py#L157)
 rather than throwing exception and getting results 
[asynchronously](https://github.com/apache/superset/blob/554ef07eeda094f5bcc081e7a265e0b7408e0868/superset/charts/data/api.py#L345).
   
   I also suspect that when query is forced, there's not need to check cache at 
all.


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