apache / apache/superset

Stop button in Chart view doesn't stop running query in Trino, and other databases

Open
#35,347 4 comments 0 reactions 0 assignees View on GitHub
api validation:required
Dominant language
Python
Stars
74.8k
Forks
18.3k
Avg merge
2d 7h
Merged PRs (30d)
692

Description

### Bug description

When running a query in Chart view or Dashboard view, Clicking "Stop" button does not have effect to the running query. Clicking Stop button, closing tab, refreshing page or going to other page leaves the query running in Trino, and other databases.

**How to reproduce the bug**
- Go to 'Chart' view
- Click on 'Update Chart' to execute query
- Click on 'Stop' to stop query

**Expected results**
Running query is cancelled in a database.

**Actual results**
Nothing happens.

### Screenshots/recordings

_No response_

### Superset version

master / latest-dev

### Python version

3.11

### Node version

18 or greater

### Browser

Chrome

### Additional context

Clicking "Stop" button aborts fetch request, but that doesn't cancel running query in a database since no cancel query is handle on the backend side after the button is clicked unlike the SQL Lab view which cancel the query by sending stop request to backend when clicking "Stop"

To stop a running query we need to terminate query in Trino database.

Similar issue have been posted, but got close https://github.com/apache/superset/issues/24890

### Checklist

- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [ ] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Contributor guide

Open the contributing guide

Research direction

Start with the Chart and Dashboard query execution flows and compare their Stop behavior with SQL Lab, which sends a stop request to the backend. Trace how the database query is started and cancelled, then verify that Stop, closing the tab, refreshing, and navigation terminate the running query in Trino and other databases.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.