rusackas opened a new pull request, #43911: URL: https://github.com/apache/superset/pull/43911
### SUMMARY Fixes for the two remaining review findings on #43407. **Per-tab consumer list lost on executor writes.** `ChartQueryConsumerPolicy` kept its `"<principal>:<tab_id>"` list in `private.task`, but `TaskContext` snapshots the whole properties blob at pickup and every later write (`_set_abortable`, `update_task`, the terminal transition) replaced the column with that snapshot. A tab that joined a SHARED task after the worker picked it up was silently dropped: the other tab's detach then aborted work the joining tab still awaited, and per-tab `task.status` fanout skipped it. For contribution charts the window is the whole totals query. The list now lives in a policy-owned `private.subscription` namespace. Policy hooks write it through a new `TaskDAO.merge_subscription_state`, which flushes, refreshes the entity from a `FOR UPDATE` read, and merges, so the write lands on top of whatever the executor committed since the caller loaded the task (this also closes the reverse clobber, where a join could wipe `is_abortable` and the engine cancel handle). The executor's whole-blob writers, `set_properties_and_payload` and `conditional_status_update`, take the same row lock, re-read that subtree and carry it through, so the two writers serialize instead of clobbering each other. The Task List debug bubble shows the new namespace next to `framework`/`task`. Docs and the `superset-core` docstrings are updated to point policies at the new namespace and helper. **Guest subscriber key rotated with every token refresh.** `get_current_guest_subscriber_key` HMAC'd `iat`/`exp` into the key, but the embedded SDK re-issues the guest token on a fixed cadence (about every 5 minutes at the default lifetime), so the polls after a refresh no longer matched the subscriber row and the chart spun to the stale timeout. Issuance claims are dropped from the message; tokens with identical scope claims carry identical entitlements, so sharing a key across them grants nothing extra. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF N/A ### TESTING INSTRUCTIONS ``` pytest tests/unit_tests/daos/test_tasks.py tests/unit_tests/tasks/test_guest.py tests/unit_tests/tasks/test_async_queries.py pytest tests/integration_tests/tasks/commands/test_cancel.py npm run test -- src/features/tasks/TaskPayloadPopover.test.tsx ``` New unit tests cover: an executor whole-blob write preserving a consumer added after its snapshot, the terminal transition doing the same, a policy merge keeping executor-written keys it was loaded before, the in-memory fallback for a detached model, the end-to-end join-during-execution shape (tab B joins, worker flags abortable, both tabs still routed and tab A's detach does not abort), and a refreshed guest token keeping its key. Manual: open a dashboard with a contribution chart in tab A, open the same dashboard in tab B while the totals query is still running, close tab A, and confirm tab B's chart completes instead of erroring with an aborted task. ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [x] Required feature flags: `GLOBAL_ASYNC_QUERIES` - [x] Changes UI (debug-only info bubble shows the new `private.subscription` namespace) - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] 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](https://claude.com/claude-code) https://claude.ai/code/session_01MuGcoYy6bWGc9vBTqEB6Aj -- 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]
