apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
62.01k stars 13.59k forks source link

Forced refresh async queries are executed synchronously #24889

Open ganczarek opened 1 year ago

ganczarek commented 1 year ago

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:

Actual results

Superset sends POST /api/v1/chart/data and waits for that request to return results.

Environment

Checklist

Make sure to follow these steps before submitting your issue - thank you!

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.

rusackas commented 6 months ago

Seems like the PR is getting reasonably close... hope we can get it across the finish line!

rusackas commented 1 month ago

Pinging @villebro since he's been looking at stuff in this area.