Repository navigation
fix(gtf): thread per-dashboard async_mode override into self-contained charts - #43915
Conversation
…d charts The dashboard `async_mode` override reached the Redux chart path, DrillBy, and native filters, but `ChartRenderer` wired the `resolveAsyncMode` hook with no argument, so self-contained charts (StatefulChart / the Matrixify sub-chart path) ignored a dashboard's `force_on`/`force_off` and always fell through to the deployment default. Read the override at the connected boundary (`ChartContainer` mapStateToProps, via `selectAsyncModeOverride`) and thread it through `Chart` → `ChartRenderer` into `resolveAsyncMode(asyncModeOverride)`, keeping the presentational components store-agnostic (undefined outside a dashboard resolves to the default). Adds a regression test asserting the override reaches the hook. Also documents a known limitation of the `status_changes` poll cursor (`floored_status_cursor`): it is stamped on the web tier's clock while a task's `changed_on` is stamped by the committing worker, so worker clock skew beyond the floored second can hide a completion from poll-mode clients until the stale timeout. Notes the DB-stamped-timestamp follow-up. Follow-ups from the #43407 review (non-blocking).
|
Bito Automatic Review Skipped - Branch Excluded |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| Known limitation: this cursor is stamped on the web tier's clock, while a | ||
| task's ``changed_on`` on a terminal transition is stamped by whichever worker | ||
| committed it. If a worker's clock trails the web tier by more than the floored | ||
| second, that completion can sit just under the ``>=`` bound and be skipped by | ||
| every poll, so a poll-mode client resolves the chart only at its stale timeout |
There was a problem hiding this comment.
Suggestion: The poll cursor uses the web clock while worker completions use worker clocks, so clock skew can permanently hide completion and delay charts until timeout. [race condition]
Assessment: 🟠 Major · 🔁 Occurrence: Rarely
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** superset/tasks/utils.py
**Line:** 211:215
**Comment:**
*Race Condition: The poll cursor uses the web clock while worker completions use worker clocks, so clock skew can permanently hide completion and delay charts until timeout.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix|
The flagged issue is a known limitation where the The PR already documents this limitation in superset/tasks/utils.py |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## gaq-to-gtf #43915 +/- ##
===========================================
Coverage 79.79% 79.79%
===========================================
Files 2913 2913
Lines 170219 170221 +2
Branches 39456 39456
===========================================
+ Hits 135830 135834 +4
+ Misses 31866 31864 -2
Partials 2523 2523
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
SUMMARY
Follow-up from the #43407 review (non-blocking).
Per-dashboard
async_modeoverride ignored by self-contained charts. The dashboardasync_modeoverride reached the Redux chart path, DrillBy, and native filters (all readselectAsyncModeOverride/useAsyncModeOverride), butChartRendererwired the injectedresolveAsyncModehook with no argument (resolveAsyncMode: () => resolveAsyncMode()), so self-contained charts in@superset-ui/core(StatefulChart— the Matrixify sub-chart path) never saw a dashboard'sforce_on/force_offand always fell through to the deployment default.The override is now read at the connected boundary (
ChartContainermapStateToPropsviaselectAsyncModeOverride) and threaded throughChart→ChartRendererintoresolveAsyncMode(asyncModeOverride).ChartRenderer/Chartstay store-agnostic (nouseSelectoradded —ChartRenderer.test.tsxrenders without a Provider), andselectAsyncModeOverridereturnsundefinedoutside a dashboard (Explore/embedded) which resolves to the default, so behavior there is unchanged. A regression test assertsforce_off/force_onreach the hook.Docs note — poll-cursor clock assumption. Also documents a known limitation in the
floored_status_cursordocstring: thestatus_changespoll cursor is stamped on the web tier's clock, while a task'schanged_onon a terminal transition is stamped by whichever worker committed it. If a worker's clock trails the web tier by more than the floored second, that completion sits under thechanged_on >= cursorbound and a poll-mode client resolves the chart only at its stale timeout (the websocket transport is unaffected — it delivers completion directly). Operators should keep the web and worker tiers clock-synced (NTP); the robust fix is a DB-stamped status timestamp (as the orphan reaper already uses the DB clock), tracked as a follow-up in #43407.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TESTING INSTRUCTIONS
Manual: on a deployment with
GLOBAL_ASYNC_QUERIESenabled, set a dashboard's async override toforce_off(Properties → Advanced) and confirm a Matrixify chart on it requests synchronous (200) chart data instead of async; set it toforce_onand confirm it goes async.ADDITIONAL INFORMATION
GLOBAL_ASYNC_QUERIES🤖 Generated with Claude Code