Skip to content

fix(gtf): thread per-dashboard async_mode override into self-contained charts - #43915

Merged
villebro merged 1 commit into
gaq-to-gtffrom
fix/async-mode-override-selfcontained-charts
Sep 5, 2026
Merged

villebro merged 1 commit into
gaq-to-gtffrom
fix/async-mode-override-selfcontained-charts

Conversation

@villebro

@villebro villebro commented Sep 5, 2026

Copy link
Copy Markdown
Member

SUMMARY

Follow-up from the #43407 review (non-blocking).

Per-dashboard async_mode override ignored by self-contained charts. The dashboard async_mode override reached the Redux chart path, DrillBy, and native filters (all read selectAsyncModeOverride/useAsyncModeOverride), but ChartRenderer wired the injected resolveAsyncMode hook with no argument (resolveAsyncMode: () => resolveAsyncMode()), so self-contained charts in @superset-ui/core (StatefulChart — the Matrixify sub-chart path) never saw a dashboard's force_on/force_off and always fell through to the deployment default.

The override is now read at the connected boundary (ChartContainer mapStateToProps via selectAsyncModeOverride) and threaded through Chart → ChartRenderer into resolveAsyncMode(asyncModeOverride). ChartRenderer/Chart stay store-agnostic (no useSelector added — ChartRenderer.test.tsx renders without a Provider), and selectAsyncModeOverride returns undefined outside a dashboard (Explore/embedded) which resolves to the default, so behavior there is unchanged. A regression test asserts force_off/force_on reach the hook.

Docs note — poll-cursor clock assumption. Also documents a known limitation in the floored_status_cursor docstring: the status_changes poll 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 sits under the changed_on >= cursor bound 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

npm run test -- src/components/Chart/ChartRenderer.test.tsx

Manual: on a deployment with GLOBAL_ASYNC_QUERIES enabled, set a dashboard's async override to force_off (Properties → Advanced) and confirm a Matrixify chart on it requests synchronous (200) chart data instead of async; set it to force_on and confirm it goes async.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags: GLOBAL_ASYNC_QUERIES
  • 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

🤖 Generated with Claude Code

…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-code-review

bito-code-review Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the branch exclusion settings here, or contact your Bito workspace admin at [email protected].

@netlify

netlify Bot commented Sep 5, 2026

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit a2fb7c1
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a9b70b1e4770c000869340b
😎 Deploy Preview https://deploy-preview-43915--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment thread superset/tasks/utils.py
Comment on lines +211 to +215
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

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

@bito-code-review

Copy link
Copy Markdown
Contributor

The flagged issue is a known limitation where the floored_status_cursor relies on the web server's local clock, while worker-side completions use the worker's clock. This clock skew can cause completions to be missed by polling until a timeout occurs.

The PR already documents this limitation in superset/tasks/utils.py (lines 211-219) and notes that the robust fix is to use a database-stamped timestamp, which is tracked as a follow-up. No code change is required to resolve this as it is a documented architectural limitation being addressed in a future task.

superset/tasks/utils.py

+    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
+    (the websocket transport is unaffected — it delivers completion directly). Keep
+    the web and worker tiers clock-synced (e.g. NTP). The robust fix is a
+    DB-stamped status timestamp — as the orphan reaper already uses the DB clock
+    rather than the app clock — which is tracked as a follow-up.

@villebro
villebro merged commit 423e175 into gaq-to-gtf Sep 5, 2026
65 checks passed
@villebro
villebro deleted the fix/async-mode-override-selfcontained-charts branch September 5, 2026 01:46
@codecov

codecov Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.79%. Comparing base (067cc9d) to head (a2fb7c1).
⚠️ Report is 1 commits behind head on gaq-to-gtf.

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           
Flag Coverage Δ
hive 37.66% <ø> (ø)
javascript 75.34% <100.00%> (+<0.01%) ⬆️
mysql 57.34% <ø> (ø)
postgres 57.37% <ø> (ø)
presto 39.54% <ø> (ø)
python 84.19% <ø> (ø)
sqlite 57.08% <ø> (ø)
unit 75.02% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant