You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "shelkesays (via GitHub)" <gi...@apache.org> on 2026/05/29 06:13:02 UTC
[I] Refresh dashboard button fires all chart data requests at once [superset]
shelkesays opened a new issue, #40511:
URL: https://github.com/apache/superset/issues/40511
### What happens
When I click the Refresh dashboard button on a dashboard with many charts, the frontend fires a separate POST to /api/v1/chart/data for every chart all at once. On larger dashboards this saturates the gunicorn workers and we start seeing request timeouts and NS_BINDING_ABORTED in the browser network tab.
Auto-refresh on a timer does not have this problem because that path staggers the requests across the dashboard's `stagger_time` metadata (default 5 seconds). The manual refresh button skips the stagger and uses `Promise.all` with no delay.
### Where it is in the code
The behavior comes from `fetchCharts` in `superset-frontend/src/dashboard/actions/dashboardState.ts`. When `interval` is 0 it takes the unstaggered branch:
\`\`\`ts
if (!interval) {
return Promise.all(
chartList.map(chartKey =>
Promise.resolve(dispatch(refreshChart(chartKey, force, dashboardId))),
),
);
}
\`\`\`
The manual refresh button ends up in this branch because \`useHeaderAutoRefresh.forceRefresh\` passes \`interval=0\`.
### Steps to reproduce
1. Open a dashboard with 15 or more charts.
2. Open the browser DevTools and watch the Network tab.
3. Click the Refresh dashboard button.
4. All chart-data POSTs go out at the same time, and several of them get aborted or time out depending on the backend's worker pool.
### What I expected
Manual refresh should respect the same \`stagger_time\` metadata that auto-refresh uses, so the request load gets spread out a bit instead of arriving as one burst.
### Related work
PR #37018, merged in 6.0.1 and 6.1.0, fixes the infinite re-render cascade with nested tabs. This issue is a separate concern. Even on dashboards without nested tabs, the manual refresh button still causes the simultaneous-burst problem. Passing a non-zero interval through to \`fetchCharts\` is enough to route it through the staggered branch.
### Version
Superset 6.0.0, also reproducible on master at the time of writing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Refresh dashboard button fires all chart data requests at once [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #40511: Refresh dashboard button fires all chart data requests at once
URL: https://github.com/apache/superset/issues/40511
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Refresh dashboard button fires all chart data requests at once [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #40511:
URL: https://github.com/apache/superset/issues/40511#issuecomment-4571401142
<!-- Greeting -->
Hi @shelkesays! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team.
<!-- Answer -->
Good analysis. I can confirm the behavior you're describing and add some detail from the code.
In `fetchCharts` [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/actions/dashboardState.js#L540-L545), the unstaggered branch looks like this:
```ts
if (!interval) {
chartList.forEach(chartKey =>
dispatch(refreshChart(chartKey, force, dashboardId)),
);
return;
}
```
The manual refresh button in the header explicitly passes `interval=0` [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/Header/index.jsx#L391):
```ts
return boundActionCreators.onRefresh(chartIds, true, 0, dashboardInfo.id);
```
This causes the early return, completely skipping the staggered branch that reads `stagger_time` and `stagger_refresh` from dashboard metadata [[3]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/actions/dashboardState.js#L547-L563).
A minimal fix would be to pass a non-zero interval (e.g., the dashboard's `stagger_time` metadata, defaulting to 5000ms) from the `forceRefresh` callback instead of hardcoding `0`. That would route manual refresh through the same staggered branch that auto-refresh uses. Something like:
```ts
const forceRefresh = useCallback(() => {
if (!isLoading) {
const interval = dashboardInfo.metadata?.stagger_time || 5000;
return boundActionCreators.onRefresh(chartIds, true, interval, dashboardInfo.id);
}
return false;
}, [boundActionCreators, chartIds, dashboardInfo, isLoading]);
```
Alternatively, the staggering logic in `fetchCharts` itself could be refactored so the branch decision isn't solely based on `interval` — e.g., always check `stagger_refresh` metadata regardless of the interval value, and use `stagger_time` for the delay calculation when interval is 0.
Worth noting: the `stagger_refresh` and `stagger_time` values are configurable via the dashboard's JSON Metadata editor [[4]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/docs/docs/faq.mdx#L115-L122), so users already have per-dashboard control over whether staggering is enabled and how long it spans.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=88dab223-549e-423b-84da-5a04369912a5) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fsuperset)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Refresh dashboard button fires all chart data requests at once [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #40511:
URL: https://github.com/apache/superset/issues/40511#issuecomment-4571656331
<!-- Answer -->
You're right on all counts — thank you for the corrections and for linking the specific commit. I verified at `b0da0cf202`:
- [`useHeaderAutoRefresh.ts`](https://github.com/apache/superset/blob/b0da0cf202/superset-frontend/src/dashboard/components/Header/useHeaderAutoRefresh.ts) is indeed present, with `forceRefresh` passing `interval=0` to trigger the unstaggered path [[1]](https://github.com/apache/superset/blob/b0da0cf202/superset-frontend/src/dashboard/components/Header/useHeaderAutoRefresh.ts).
- [`dashboardState.ts`](https://github.com/apache/superset/blob/b0da0cf202/superset-frontend/src/dashboard/actions/dashboardState.ts) is `.ts`, not `.js` [[2]](https://github.com/apache/superset/blob/b0da0cf202/superset-frontend/src/dashboard/actions/dashboardState.ts).
My earlier response was working from a stale index — apologies for the confusion. Your summary of the current flow is accurate: `useHeaderAutoRefresh.forceRefresh` → `fetchCharts` with `interval=0` → unstaggered dispatch of all charts. PR #40512 modifying both of those files to route manual refresh through the staggered branch makes sense as the fix path.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fsuperset&message_id=a06defbf-badc-4ac2-86c4-58ac4c909fe6) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fsuperset)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Refresh dashboard button fires all chart data requests at once [superset]
Posted by "shelkesays (via GitHub)" <gi...@apache.org>.
shelkesays commented on issue #40511:
URL: https://github.com/apache/superset/issues/40511#issuecomment-4571646489
@dosu thanks for the response. To help anyone reading along who might compare references, I double-checked the current apache/master tree at `b0da0cf202` and a few things look different from what was described.
Looking at master right now:
- `useHeaderAutoRefresh.ts` is already present. It was introduced by PR #37459 ("feat: auto refresh dashboard") and is the file this PR modifies rather than creating. https://github.com/apache/superset/blob/b0da0cf202/superset-frontend/src/dashboard/components/Header/useHeaderAutoRefresh.ts
- `dashboardState` is `.ts` on master, not `.js`. https://github.com/apache/superset/blob/b0da0cf202/superset-frontend/src/dashboard/actions/dashboardState.ts
- `useHeaderActionsDropdownMenu.tsx` does exist (added by PR #31972 during the Ant Design 5 migration), but it is the dropdown menu, not the refresh hook.
I also want to correct myself: in my previous comment I said `useHeaderAutoRefresh.ts` came from PR #37018. That was wrong on my part. PR #37018 is the nested-tab cascade fix that added `handledRefreshRef` and `isLazyLoad` to `Tab.tsx` and `dashboardState.ts`. The hook itself came from PR #37459, per the commit history. Apologies for any confusion that caused.
So the picture for human reviewers: on current master, the manual refresh callback flows through `useHeaderAutoRefresh.forceRefresh` in `useHeaderAutoRefresh.ts`, and the staggered branch lives in `fetchCharts` in `dashboardState.ts`. PR #40512 modifies both.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Refresh dashboard button fires all chart data requests at once [superset]
Posted by "shelkesays (via GitHub)" <gi...@apache.org>.
shelkesays commented on issue #40511:
URL: https://github.com/apache/superset/issues/40511#issuecomment-4571541067
@dosu thanks for the confirmation. Quick note on the file paths: after PR #37018 the refresh logic moved out of `Header/index.jsx` and into `Header/useHeaderAutoRefresh.ts`, and `dashboardState.js` is now `dashboardState.ts`. Anyone looking at master will not see the line numbers above.
PR #40512 takes the same direction you described. The small difference is that it adds an opt-in server config `SUPERSET_DASHBOARD_MANUAL_REFRESH_STAGGER_MS` (defaulting to 5000) so operators can set a global default without asking every dashboard owner to edit JSON metadata. The per-dashboard `stagger_time` metadata still wins where larger, since `fetchCharts` uses `Math.max(interval, stagger_time || 5000)`. Setting the config to 0 keeps the old unstaggered behavior for anyone who wants it.
The deeper refactor you mentioned, where the staggering branch in `fetchCharts` keys off `stagger_refresh` instead of `interval`, sounds like a cleaner end state. Happy to take that on in a follow-up if maintainers prefer it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Refresh dashboard button fires all chart data requests at once [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #40511:
URL: https://github.com/apache/superset/issues/40511#issuecomment-4571558983
<!-- Answer -->
Thanks for the correction on the file paths — I appreciate you flagging that. To clarify what I'm seeing on master right now: `dashboardState` is still `.js` (not `.ts`) and `useHeaderAutoRefresh.ts` appears to be introduced by your PR #40512 rather than by #37018 [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/actions/dashboardState.js) [[2]](https://github.com/apache/superset/pull/40512). The current master has the refresh callback in `useHeaderActionsDropdownMenu.tsx` [[3]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/Header/useHeaderActionsDropdownMenu.tsx). So anyone reading along should look there for the existing behavior.
Regarding the approach in PR #40512 — the server-side `SUPERSET_DASHBOARD_MANUAL_REFRESH_STAGGER_MS` config is a nice touch. Giving operators a global knob avoids the per-dashboard JSON editing burden, and having `stagger_time` win when larger preserves the existing contract for dashboards that already customized their metadata. Defaulting to 5000ms and allowing `0` to opt out keeps it backwards-compatible.
The deeper refactor (keying off `stagger_refresh` metadata instead of `interval`) would decouple "should we stagger?" from "is this a periodic refresh?" which is conceptually cleaner, but it's a bigger change surface. Doing it as a follow-up makes sense — the immediate fix in #40512 solves the user-facing problem without restructuring the control flow.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fsuperset&message_id=397ae6e0-080e-44cb-91dd-440d75156894) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fsuperset)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org