superset icon indicating copy to clipboard operation
superset copied to clipboard

fix: Forced refresh async queries are executed synchronously

Open GAlexeyV opened this issue 1 year ago • 4 comments

SUMMARY

Deleted a cache check for async queries when cache is forced. Attached screenshots (please, see below) to demonstrate logs that show expected behaviour after the change.

Fixes https://github.com/apache/superset/issues/24889

Context:

When chart data is forced to refresh in chart view, query is executed in synchronous manner, even when GLOBAL_ASYNC_QUERIES=True.

Expected results Superset should:

  1. Request chart data (POST /api/v1/chart/data?form_data=<fomr_data>)
  2. Poll for results (GET /api/v1/async_event/?last_id=<last_id>)
  3. 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.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screenshot 2024-02-23 at 13 26 05 Screenshot 2024-02-23 at 13 28 51

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • [x] Has associated issue:
  • [ ] Required feature flags:
  • [ ] Changes UI
  • [ ] Includes DB Migration (follow approval process in SIP-59)
    • [ ] 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

GAlexeyV avatar Feb 16 '24 14:02 GAlexeyV

@zhaoyongjie would you mind reviewing this? It seems, per here, that you may have authored this logic.

john-bodley avatar Feb 16 '24 18:02 john-bodley

@zhaoyongjie would you mind reviewing this? It seems, per here, that you may have authored this logic.

Let me catch up the change....thanks for the mention.

zhaoyongjie avatar Feb 16 '24 21:02 zhaoyongjie

Thanks for the review @zhaoyongjie - would love to get this merged so we can close https://github.com/apache/superset/issues/24889, which has been open for a long time.

rusackas avatar Mar 06 '24 02:03 rusackas

I wonder if @craig-rueda or @villebro know this area enough to help see this through...

rusackas avatar Apr 23 '24 16:04 rusackas

Till we figure out a better solve I've moved the cache lookup behind an if statement checking the value of force

harshit2283 avatar Aug 01 '24 08:08 harshit2283