villebro opened a new pull request, #43473:
URL: https://github.com/apache/superset/pull/43473
### SUMMARY
Targets `gaq-to-gtf`. Post-cutover robustness fixes for the GTF async
chart-data
flow, addressing review findings on the merged child PRs, plus a small
cleanup.
**Async chart-data can no longer silently hang or throw when the result
isn't cached.**
Async delivery is cache-then-read-back, so a result that never lands in the
DATA
cache (a `NullCache` backend, an oversized value, or a per-query disabled
timeout)
would previously leave the client re-requesting an uncacheable result — a
repeat
`202` the refetch handler couldn't handle. Now:
- `/chart/data` **refuses async under a `NullCache` DATA backend** and runs
synchronously (the `202`→loop can't even start); and
- if a post-completion re-request still returns `202`, the client **falls
back to a
synchronous fetch** (which returns the payload inline) instead of throwing.
**Distributed-lock release is now atomic.** The ownership-checked release
did a
separate `GET` then `DEL`; if the lock expired and was re-acquired between
them, the
stale holder could delete the new holder's lock. Replaced with a single Lua
**compare-and-delete** on the coordination backend.
**A dependent task cancelled while waiting on prerequisites no longer
publishes a
phantom `FAILURE`.** `execute_task` now only publishes `FAILURE` when the
conditional
transition actually committed; if the task was concurrently aborted, it
reports the
status that actually landed.
**Accurate DB error surfacing.** A transient metadata-DB error during a task
create/update is surfaced with its true cause (e.g. "database is locked")
instead of
the generic "Task could not be created/updated." (opt-in `preserve_message`
on the
shared `on_error`).
**Cleanup — retire the `async_events` package.** The GAQ cutover deleted
everything
in it except `cache_backend.py`, whose classes are now the coordination
service's
Redis client wrappers (not async-events/GAQ-specific). Moved to
`superset/coordination/cache_backend.py` and deleted the package.
### TESTING INSTRUCTIONS
Unit tests cover each fix:
- `pytest tests/unit_tests/charts/test_chart_data_api.py -k
should_run_async` — async
refused under `NullCache`.
- `pytest tests/unit_tests/distributed_lock/distributed_lock_tests.py` —
atomic
compare-and-delete release; a stale token doesn't drop a newer holder's
lock.
- `pytest tests/unit_tests/coordination/test_cache_backend.py` —
`compare_and_delete`
delegates to the Lua script.
- `pytest tests/unit_tests/tasks/test_dependencies.py` — a cancelled
dependent reports
the committed status, not a phantom `FAILURE`.
- `pytest tests/unit_tests/utils/test_decorators.py` — `preserve_message`
surfaces the
DBAPI cause.
- `npm run test -- src/components/Chart/chartActions.test.ts` — client sync
fallback on
a repeat `202`.
End-to-end: with `GLOBAL_ASYNC_QUERIES=on`, a persistent
`DATA_CACHE_CONFIG`, and a
Celery worker, load a dashboard and confirm charts resolve; point
`DATA_CACHE_CONFIG`
at `NullCache` and confirm requests run synchronously (no tasks scheduled).
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [x] Required feature flags: `GLOBAL_ASYNC_QUERIES` (async path only)
- [ ] Changes UI
- [ ] Includes DB 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]