villebro opened a new pull request, #43461:
URL: https://github.com/apache/superset/pull/43461

   ### SUMMARY
   
   Two P1 correctness fixes from the 
[#43407](https://github.com/apache/superset/pull/43407) review (targets 
`gaq-to-gtf`).
   
   **1. Async chart-data can hang if a task finishes before its waiter 
registers.**
   `waitForAsyncData` awaited `baselineReady` *before* registering the task 
waiter. The `202` is returned when the query tasks are **scheduled**, not 
finished, so at that instant the shared poll cursor is `<= now < any task's 
future terminal transition` — the poll would normally always catch the 
completion. But awaiting anything between receiving the `202` and registering 
the waiter opens a gap in which a fast task can reach a terminal state **and** 
a concurrent chart's poll can advance the shared cursor past that terminal 
update, while the per-principal socket event is dropped (no waiter yet). The 
chart / native filter then waits forever. Fix: register the waiter 
**synchronously in the same tick as the `202`**, before any `await`. Removed 
the now-unused `baselineReady` handle (the init poll-loop kickoff is unchanged).
   
   **2. Embedded-guest subscriber key overflows its column.**
   `superset.tasks.guest.get_current_guest_subscriber_key()` returns `"guest-"` 
+ a 64-char SHA256 hex digest = **70 chars**, but `task_subscribers.guest_key` 
was `String(64)` — so subscribing a guest-created async task would raise on 
Postgres / silently truncate on MySQL. Widened the column to `String(128)` in 
the model and the (feature-branch) migration `7e2c9a4f1b83`.
   
   Both were flagged as P1 in review. The third finding (ownership-less 
distributed-lock release) is pre-existing and touches a shared primitive used 
well beyond GTF, so it's handled in a separate PR.
   
   ### TESTING INSTRUCTIONS
   
   - `jest src/middleware/asyncEvent.test.ts` — the acceleration test now 
delivers the completion in the **same tick** with no wait, proving the waiter 
registers synchronously (regression guard for the race).
   - `pytest tests/unit_tests/daos/test_tasks.py` — a full-length (70-char) 
guest key round-trips through `add_guest_subscriber`.
   - tsc / mypy / pre-commit clean on changed files.
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue
   - [ ] Required feature flags
   - [ ] Changes UI
   - [x] Includes DB Migration (widens `task_subscribers.guest_key` in the 
existing `7e2c9a4f1b83` migration)
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
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]

Reply via email to