Remove HardLimitingWorker by @SchrosCat2013 fixing #6424 - #7194
pavelbrylov wants to merge 3 commits into
Conversation
|
@justinclift if you could help prioritize this - would be great :) Thanks! |
Greptile SummaryThis PR removes Redash's custom
Confidence Score: 4/5This PR is not safe to merge until running-query cancellation still interrupts the active work horse. The query cancellation endpoint now only updates job state; removing the custom monitor eliminates the path that observes that state and signals the process executing the database query. Files Needing Attention: redash/tasks/worker.py
|
| Filename | Overview |
|---|---|
| redash/tasks/worker.py | Removes the custom work-horse monitor and hard-limit implementation, but also drops the signal-based handling required by Redash's running-job cancellation flow. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[DELETE running query job] --> B[CancellableJob.cancel]
B --> C[Store cancelled metadata]
C --> D{Worker monitor}
D -->|Before this PR| E[Refresh cancellation state]
E --> F[Send SIGINT to work horse]
F --> G[Query runner cancels database operation]
D -->|After this PR| H[Inherited RQ monitoring]
H --> I[No Redash cancellation signal]
I --> J[Query process may continue running]
Reviews (1): Last reviewed commit: "Merge branch 'master' into master" | Re-trigger Greptile
|
|
||
|
|
||
| class RedashWorker(StatsdRecordingWorker, HardLimitingWorker): | ||
| class RedashWorker(StatsdRecordingWorker): |
There was a problem hiding this comment.
Running Cancellation No Longer Interrupts
Removing HardLimitingWorker also removes the monitor path that refreshed Redash's cancellation metadata and sent SIGINT to a running work horse. When the query-job DELETE endpoint calls CancellableJob.cancel(), the job is marked cancelled in Redis, but the executing query process is not interrupted. Its query-runner cancellation handler is therefore never invoked, and the query can continue consuming worker and database capacity.
Knowledge Base Used: Background jobs and scheduling
What type of PR is this?
Description
There is an issue with adhoc queries running longer than minute, there a lot of details in #6424 (comment)
Author of investigation and changes is @SchrosCat2013, I just adopted changes in his fork to the lates master in a hope of not having to maintain own fork :)
How is this tested?
We patched and built own image, this solves the issue and same long running query is now polled until it completes as opposed to stop polling in 1 minute.
Related Tickets & Documents
#6424