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
- Go to 'Chart'
- 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 and ignores forced_cached flag check. In result, it ends getting query results immediately rather than throwing exception and getting results asynchronously.
I also suspect that when query is forced, there's not need to check cache at all.
Comment From: rusackas
Seems like the PR is getting reasonably close... hope we can get it across the finish line!
Comment From: rusackas
Pinging @villebro since he's been looking at stuff in this area.
Comment From: rusackas
This has been silent for a long, long time. I'm still hoping we can brush up and merge the PR if it feels like the right fix, but I'm wondering if anyone is still facing this and/or willing to look at the fix. It might be closed as "not planned" eventually if it doesn't get the TLC it needs.
Comment From: Kiberskotc
Hi, @rusackas Encountered the same isshue in latest version (5.0.0.): First time new chart loads for 6+ minutes, /async_event endpoint is called continuously, everything as expected. But, when "cached" button is clicked /async_event endpoint is not beeing called even once, and load stops after 1 minute with "Request timed out" error. Same with "Force Refresh" button on dashboard.
Comment From: Devi-6901
We are using Superset 3.0.0 and are facing a similar issue. When we open the dashboard initially, it's getting loaded asynchronously from cache, but when we do refresh the dashboard, it's not using async rather using synchronous api calls.
Comment From: rusackas
3.0.0 is no longer supported, but we can keep this open since it sounds like it's still a 5.0 issue.