villebro commented on PR #43696:
URL: https://github.com/apache/superset/pull/43696#issuecomment-5471468996
Pushed `29c4e58` — **no more parallel polling while the websocket is
connected.** This was the right call: running the eager `/task/status_changes`
loop alongside an active socket defeated the point of the socket (redundant
load at exactly the moment the socket is already doing the job).
New model (matches the reviewer's recommended shape — websocket primary,
one-shot catch-up, no interval polling):
- **`WEBSOCKET_ENABLE` off:** the interval poll loop is unchanged — it's the
only mechanism for non-websocket deployments.
- **`WEBSOCKET_ENABLE` on:** the socket is the sole completion transport. We
keep the 202 cursor as a recovery watermark and run a **single**
`status_changes` catch-up (no timer/backoff/loop) only:
- **on waiter registration** — covers a task that completed before the
browser registered its waiter;
- **on socket reconnect** — covers messages missed while disconnected
("pick up where we left off").
- A per-waiter give-up bounds a genuinely-lost completion (chart errors →
a refresh recovers).
- **List views** refetch their displayed rows once on reconnect (nudges
aren't replayed).
I went with a one-shot catch-up rather than re-POSTing charts on reconnect
(per your note): it's one request per tab instead of N, reuses the existing
cursor + `status_changes` machinery, and handles failed tasks correctly (a
re-POST could restart a failed task). `realtime.ts` gained
`subscribeRealtimeOpen()` to drive the reconnect catch-up.
So the WS-down-30s scenario is now: no polling during the outage, and on
reconnect one catch-up per tab reconciles everything that finished while it was
down.
Also folded in from the prior review round (commit `0754fc0`): submit-time
tab-id via the 202 echo, cancel-endpoint tab-id validation, no principal-grain
fallback for all-invalid policy routes, keepalive at 0.6 of lifetime + the
reconnect-race guard, and stale-comment cleanup.
Tests: 75 frontend (realtime/asyncEvent/hooks incl. new WS-mode: no-loop,
registration catch-up, reconnect catch-up, give-up, list reconnect reconcile) +
backend suites green; lint/format clean.
--
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]