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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]