You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "villebro (via GitHub)" <gi...@apache.org> on 2026/08/28 22:13:59 UTC

[PR] feat(gtf): Task List type/name filters + worker self-fencing on lost metastore contact [superset]

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

   ### SUMMARY
   
   Two related Global Task Framework (GTF) improvements, against the `gaq-to-gtf` feature branch.
   
   **1. Task List filters**
   - The **Type** filter changes from a free-text `contains` match to a **select dropdown** populated from the distinct task types actually present. This exposes the `BaseSupersetModelRestApi` `/distinct/<column>` endpoint on `TaskRestApi` (`allowed_distinct_fields = {"task_type"}`); it applies `base_filters`, so the dropdown is scoped per-user exactly like the list itself.
   - A new **Name** free-text (`contains`) filter is added (`task_name` was already a `search_column`).
   
   **2. Worker self-fencing on lost metastore contact**
   The reaper (shipped in #43627) handles a *dead* worker, but a worker that is **alive yet cut off from the metastore** (network partition, metastore outage) would keep running a query the reaper has already — or will shortly — mark `FAILURE`. This adds the worker-side complement:
   
   - While a worker holds a task it heartbeats `tasks.last_heartbeat`. If those writes keep failing for longer than `GTF_ORPHAN_TASK_TIMEOUT` — the *same* window the reaper uses to declare a task orphaned — the worker **fails the task from the inside**, cancelling any in-flight warehouse query via the existing abort path (a fresh connection to the warehouse, reachable even when the metastore is not).
   - **A single failed write is tolerated**; only a sustained outage spanning the orphan window fences, so a transient blip never kills a healthy task.
   - There is **no handover** to another worker — the task simply fails (which is why this keeps the "heartbeat/orphan" framing rather than calling it a "lease").
   - **No schema change**: builds on the existing `last_heartbeat` column and `GTF_ORPHAN_TASK_TIMEOUT` config.
   
   Implementation notes:
   - `TaskContext` gains `trigger_self_fence()` + a `fence_triggered` flag, and the timeout timer's abort logic is extracted into a shared `_abort_locally()` helper (so both the timeout path and the fence path go through one code path). A fence is finalized as `FAILURE` — distinct from a timeout's `TIMED_OUT` and a user abort's `ABORTED`. `trigger_self_fence` no-ops if an abort is already underway or the task work already completed.
   - `task_heartbeat` yields a `HeartbeatController`; the executor registers the fence callback once the context is built.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   _Task List "Type" filter is now a dropdown of the distinct task types, plus a new free-text "Name" filter. (Screenshots to add.)_
   
   ### TESTING INSTRUCTIONS
   
   - **Filters:** open the Task List with `GLOBAL_TASK_FRAMEWORK` enabled; the **Type** filter is a dropdown listing distinct task types (scoped to tasks you can see), and the **Name** filter does a substring match on the task name.
   - **Self-fencing (manual):** with a Celery worker + a cancellable engine (e.g. Postgres) + `DISTRIBUTED_COORDINATION_CONFIG`, start an async chart query, then sever the worker's connection to the metastore for longer than `GTF_ORPHAN_TASK_TIMEOUT`. The worker fails the task from the inside and the backend query disappears from `pg_stat_activity`; a brief blip shorter than the window does not fence.
   - **Automated:** `pytest tests/unit_tests/tasks/` (heartbeat self-fence, context `trigger_self_fence`, executor fence-finalization).
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags: `GLOBAL_TASK_FRAMEWORK`
   - [x] 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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(gtf): Task List type/name filters + worker self-fencing on lost metastore contact [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #43659:
URL: https://github.com/apache/superset/pull/43659#issuecomment-5458317629

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(gtf): Task List type/name filters + worker self-fencing on lost metastore contact [superset]

Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro merged PR #43659:
URL: https://github.com/apache/superset/pull/43659


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(gtf): Task List type/name filters + worker self-fencing on lost metastore contact [superset]

Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #43659:
URL: https://github.com/apache/superset/pull/43659#issuecomment-5458330920

   ### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">🔨</span> Latest commit | 0215e4f4afdb9643c9056f93430998d21ba33c75 |
   |<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6a920826f41ea300080a01c7 |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-43659--superset-docs-preview.netlify.app](https://deploy-preview-43659--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTQzNjU5LS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.1JLNoQQAXoKwAd2IudC0bkAyN_5T3f7OwNR6-76rrB0)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   |<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#DcpJCoAwDADAv-RsMS64_cBnRE21GG2pQRDx7_Y2h3khRH8EhQEggynSOW_JtxPhKfp8VWuUrl3cpUafwMY6UY4pLxzEP-OSekN9iV3Z2LpgqhCxQ8JibuH7AQ) |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-43659--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(gtf): Task List type/name filters + worker self-fencing on lost metastore contact [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #43659:
URL: https://github.com/apache/superset/pull/43659#issuecomment-5458460309

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(gtf): Task List type/name filters + worker self-fencing on lost metastore contact [superset]

Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro commented on PR #43659:
URL: https://github.com/apache/superset/pull/43659#issuecomment-5458459214

   /review


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(gtf): Task List type/name filters + worker self-fencing on lost metastore contact [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #43659:
URL: https://github.com/apache/superset/pull/43659#issuecomment-5458587591

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/43659?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `46.05263%` with `41 lines` in your changes missing coverage. Please review.
   :warning: Please [upload](https://docs.codecov.com/docs/codecov-uploader) report for BASE (`gaq-to-gtf@96ca860`). [Learn more](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#section-missing-base-commit) about missing BASE report.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/43659?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [superset/tasks/context.py](https://app.codecov.io/gh/apache/superset/pull/43659?src=pr&el=tree&filepath=superset%2Ftasks%2Fcontext.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvdGFza3MvY29udGV4dC5weQ==) | 31.03% | [20 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/43659?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [superset/tasks/heartbeat.py](https://app.codecov.io/gh/apache/superset/pull/43659?src=pr&el=tree&filepath=superset%2Ftasks%2Fheartbeat.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvdGFza3MvaGVhcnRiZWF0LnB5) | 58.33% | [14 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/superset/pull/43659?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [superset/tasks/scheduler.py](https://app.codecov.io/gh/apache/superset/pull/43659?src=pr&el=tree&filepath=superset%2Ftasks%2Fscheduler.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvdGFza3Mvc2NoZWR1bGVyLnB5) | 40.00% | [3 Missing and 3 partials :warning: ](https://app.codecov.io/gh/apache/superset/pull/43659?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@              Coverage Diff              @@
   ##             gaq-to-gtf   #43659   +/-   ##
   =============================================
     Coverage              ?   66.16%           
   =============================================
     Files                 ?     2890           
     Lines                 ?   166470           
     Branches              ?    38462           
   =============================================
     Hits                  ?   110152           
     Misses                ?    54079           
     Partials              ?     2239           
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/43659/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [hive](https://app.codecov.io/gh/apache/superset/pull/43659/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `37.98% <22.36%> (?)` | |
   | [presto](https://app.codecov.io/gh/apache/superset/pull/43659/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `39.89% <22.36%> (?)` | |
   | [python](https://app.codecov.io/gh/apache/superset/pull/43659/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `57.48% <46.05%> (?)` | |
   | [sqlite](https://app.codecov.io/gh/apache/superset/pull/43659/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `57.34% <46.05%> (?)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/43659?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org