You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "raushanprabhakar1 (via GitHub)" <gi...@apache.org> on 2026/04/23 19:03:50 UTC
[PR] Move KubernetesPodTrigger pod cleanup from cleanup() to on_kill() [airflow]
raushanprabhakar1 opened a new pull request, #65741:
URL: https://github.com/apache/airflow/pull/65741
<!-- SPDX-License-Identifier: Apache-2.0
https://www.apache.org/licenses/LICENSE-2.0 -->
<!--
Thank you for contributing!
Please provide above a brief description of the changes made in this pull request.
Write a good git commit message following this guide: http://chris.beams.io/posts/git-commit/
Please make sure that your code changes are covered with tests.
And in case of new features or big changes remember to adjust the documentation.
Feel free to ping (in general) for the review if you do not see reaction for a few days
(72 Hours is the minimum reaction time you can expect from volunteers) - we sometimes miss notifications.
In case of an existing issue, reference it using one of the following:
* closes: #ISSUE
* related: #ISSUE
-->
`KubernetesPodTrigger` now cancels external work only through `BaseTrigger.on_kill()` instead of the previous `cleanup()` path that used `safe_to_cancel()` to distinguish user kills from triggerer restarts. Pod deletion on user-initiated kill is unchanged in intent: it still respects `_fired_event`, `on_kill_action`, and `termination_grace_period`; triggerer shutdown or redistribution no longer goes through pod-deletion logic in this trigger.
Unit tests were updated to assert `on_kill` behavior instead of `cleanup` / `safe_to_cancel`.
related: #65733
---
##### Was generative AI tooling used to co-author this PR?
<!--
If generative AI tooling has been used in the process of authoring this PR, please
change below checkbox to `[X]` followed by the name of the tool, uncomment the "Generated-by".
-->
- [X] Yes — Cursor (GPT-based agent)
<!--
Generated-by: Cursor (GPT-based agent) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
-->
---
* Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
* For fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
* When adding dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
* For significant user-facing changes create newsfragment: `{pr_number}.significant.rst`, in [airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments). You can add this file in a follow-up commit after the PR is created so you know the PR number.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move KubernetesPodTrigger pod cleanup from cleanup() to on_kill() [airflow]
Posted by "amoghrajesh (via GitHub)" <gi...@apache.org>.
amoghrajesh commented on PR #65741:
URL: https://github.com/apache/airflow/pull/65741#issuecomment-4332304664
I will take a look too
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move KubernetesPodTrigger pod cleanup from cleanup() to on_kill() [airflow]
Posted by "amoghrajesh (via GitHub)" <gi...@apache.org>.
amoghrajesh merged PR #65741:
URL: https://github.com/apache/airflow/pull/65741
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move KubernetesPodTrigger pod cleanup from cleanup() to on_kill() [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #65741:
URL: https://github.com/apache/airflow/pull/65741#issuecomment-4323637247
@raushanprabhakar1 — There are 2 unresolved review threads on this PR from @jscheffl. Could you either push a fix or reply in each thread explaining why the feedback doesn't apply? Once you believe the feedback is addressed, mark the thread as resolved so the reviewer isn't re-pinged needlessly. Thanks!
---
_Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this [two-stage triage process](https://github.com/apache/airflow/blob/main/contributing-docs/25_maintainer_pr_triage.md#why-the-first-pass-is-automated) so that our maintainers' limited time is spent where it matters most: the conversation with you._
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move KubernetesPodTrigger pod cleanup from cleanup() to on_kill() [airflow]
Posted by "jscheffl (via GitHub)" <gi...@apache.org>.
jscheffl commented on code in PR #65741:
URL: https://github.com/apache/airflow/pull/65741#discussion_r3140111143
##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/triggers/pod.py:
##########
@@ -411,17 +414,52 @@ async def get_task_state(self):
async def safe_to_cancel(self) -> bool:
"""
- Whether it is safe to cancel the external job which is being executed by this trigger.
+ Whether it is safe to delete the pod during trigger cleanup.
- Cancel is NOT safe when the task is still in DEFERRED state, because it means the
- triggerer is redistributing triggers and the trigger will be recreated on another triggerer.
- Cancel IS safe when the task state has changed (e.g. user marked it as success/failed).
+ Used only on Airflow < 3.3.0 where the triggerer does not invoke ``on_kill()`` for user kills.
+ Cancel is NOT safe when the task is still in DEFERRED state (triggerer restart).
"""
task_state = await self.get_task_state()
return task_state != TaskInstanceState.DEFERRED
+ async def on_kill(self) -> None:
+ """
+ Delete the pod when the trigger is cancelled by a user action.
+
+ On Airflow 3.3.0+ the triggerer invokes this for user-initiated kills. On older versions this
+ is a no-op; use ``cleanup()`` and ``safe_to_cancel()`` instead.
+ """
+ if not AIRFLOW_V_3_3_PLUS:
+ return
Review Comment:
I think this is not needed? This is never called when Airflow < 3.3.0
##########
providers/cncf/kubernetes/tests/unit/cncf/kubernetes/triggers/test_pod.py:
##########
@@ -561,7 +562,8 @@ async def test__get_pod_retries(
@pytest.mark.asyncio
@mock.patch(f"{TRIGGER_PATH}.hook")
- async def test_cleanup_does_not_delete_when_fired_event(self, mock_hook):
+ @mock.patch(f"{POD_TRIGGER_MODULE}.AIRFLOW_V_3_3_PLUS", True)
+ async def test_on_kill_does_not_delete_when_fired_event(self, mock_hook):
Review Comment:
We have back-compat tests and CI runs them on all (supported) Airflow versions. Can you rather model it with `skipif=AIRFLOW_V_x_y_PLUS`? Then tests are running automatically only in respective environment and no additional test complexity needed.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move KubernetesPodTrigger pod cleanup from cleanup() to on_kill() [airflow]
Posted by "raushanprabhakar1 (via GitHub)" <gi...@apache.org>.
raushanprabhakar1 commented on PR #65741:
URL: https://github.com/apache/airflow/pull/65741#issuecomment-4314410003
Hi @jscheffl , Thanks for the feedback, i have addressed your valuable feedback, please do 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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move KubernetesPodTrigger pod cleanup from cleanup() to on_kill() [airflow]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #65741:
URL: https://github.com/apache/airflow/pull/65741#issuecomment-4341379468
Awesome work, congrats on your first merged pull request! You are invited to check our [Issue Tracker](https://github.com/apache/airflow/issues) for additional contributions.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move KubernetesPodTrigger pod cleanup from cleanup() to on_kill() [airflow]
Posted by "raushanprabhakar1 (via GitHub)" <gi...@apache.org>.
raushanprabhakar1 commented on code in PR #65741:
URL: https://github.com/apache/airflow/pull/65741#discussion_r3156403963
##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/triggers/pod.py:
##########
@@ -411,17 +414,50 @@ async def get_task_state(self):
async def safe_to_cancel(self) -> bool:
"""
- Whether it is safe to cancel the external job which is being executed by this trigger.
+ Whether it is safe to delete the pod during trigger cleanup.
- Cancel is NOT safe when the task is still in DEFERRED state, because it means the
- triggerer is redistributing triggers and the trigger will be recreated on another triggerer.
- Cancel IS safe when the task state has changed (e.g. user marked it as success/failed).
+ Used only on Airflow < 3.3.0 where the triggerer does not invoke ``on_kill()`` for user kills.
+ Deletion is NOT safe when the task is still in DEFERRED state (triggerer restart).
"""
task_state = await self.get_task_state()
return task_state != TaskInstanceState.DEFERRED
+ async def on_kill(self) -> None:
+ """
+ Delete the pod when the trigger is cancelled by a user action.
+
+ The triggerer invokes this for user-initiated kills on Airflow 3.3.0+ only; on older versions
+ use ``cleanup()`` and ``safe_to_cancel()`` instead.
+ """
+ if self._fired_event:
+ self.log.debug("Skipping on_kill since an event has already been fired.")
+ return
+
+ if self.on_kill_action == OnKillAction.KEEP_POD:
+ self.log.debug("Skipping on_kill since on_kill_action is set to %r.", self.on_kill_action.value)
+ return
+
+ self.log.info("Deleting pod %s in namespace %s.", self.pod_name, self.pod_namespace)
+ try:
+ await self.hook.delete_pod(
+ name=self.pod_name,
+ namespace=self.pod_namespace,
+ grace_period_seconds=self.termination_grace_period,
+ )
+ except Exception:
+ self.log.exception("Unexpected error while deleting pod %s", self.pod_name)
+
async def cleanup(self) -> None:
- """Clean up the pod when the trigger is cancelled."""
+ """
+ Clean up the pod when the trigger exits.
+
+ On Airflow 3.3.0+ pod deletion on user kill is handled in ``on_kill()`` only; this avoids
+ deleting pods on triggerer restart. On older Airflow versions, ``cleanup()`` still uses
+ ``safe_to_cancel()`` because ``on_kill()`` is not wired for user kills.
+ """
+ if AIRFLOW_V_3_3_PLUS:
+ return
Review Comment:
Hi @amoghrajesh , added the TODO section, please do review, Thanks.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move KubernetesPodTrigger pod cleanup from cleanup() to on_kill() [airflow]
Posted by "amoghrajesh (via GitHub)" <gi...@apache.org>.
amoghrajesh commented on code in PR #65741:
URL: https://github.com/apache/airflow/pull/65741#discussion_r3158974207
##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/triggers/pod.py:
##########
@@ -411,17 +414,50 @@ async def get_task_state(self):
async def safe_to_cancel(self) -> bool:
"""
- Whether it is safe to cancel the external job which is being executed by this trigger.
+ Whether it is safe to delete the pod during trigger cleanup.
- Cancel is NOT safe when the task is still in DEFERRED state, because it means the
- triggerer is redistributing triggers and the trigger will be recreated on another triggerer.
- Cancel IS safe when the task state has changed (e.g. user marked it as success/failed).
+ Used only on Airflow < 3.3.0 where the triggerer does not invoke ``on_kill()`` for user kills.
+ Deletion is NOT safe when the task is still in DEFERRED state (triggerer restart).
"""
task_state = await self.get_task_state()
return task_state != TaskInstanceState.DEFERRED
+ async def on_kill(self) -> None:
+ """
+ Delete the pod when the trigger is cancelled by a user action.
+
+ The triggerer invokes this for user-initiated kills on Airflow 3.3.0+ only; on older versions
+ use ``cleanup()`` and ``safe_to_cancel()`` instead.
+ """
+ if self._fired_event:
+ self.log.debug("Skipping on_kill since an event has already been fired.")
+ return
+
+ if self.on_kill_action == OnKillAction.KEEP_POD:
+ self.log.debug("Skipping on_kill since on_kill_action is set to %r.", self.on_kill_action.value)
+ return
+
+ self.log.info("Deleting pod %s in namespace %s.", self.pod_name, self.pod_namespace)
+ try:
+ await self.hook.delete_pod(
+ name=self.pod_name,
+ namespace=self.pod_namespace,
+ grace_period_seconds=self.termination_grace_period,
+ )
+ except Exception:
+ self.log.exception("Unexpected error while deleting pod %s", self.pod_name)
+
async def cleanup(self) -> None:
- """Clean up the pod when the trigger is cancelled."""
+ """
+ Clean up the pod when the trigger exits.
+
+ On Airflow 3.3.0+ pod deletion on user kill is handled in ``on_kill()`` only; this avoids
+ deleting pods on triggerer restart. On older Airflow versions, ``cleanup()`` still uses
+ ``safe_to_cancel()`` because ``on_kill()`` is not wired for user kills.
+ """
+ if AIRFLOW_V_3_3_PLUS:
+ return
Review Comment:
Awesome, thank you
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move KubernetesPodTrigger pod cleanup from cleanup() to on_kill() [airflow]
Posted by "raushanprabhakar1 (via GitHub)" <gi...@apache.org>.
raushanprabhakar1 commented on code in PR #65741:
URL: https://github.com/apache/airflow/pull/65741#discussion_r3144968215
##########
providers/cncf/kubernetes/tests/unit/cncf/kubernetes/triggers/test_pod.py:
##########
@@ -561,7 +562,8 @@ async def test__get_pod_retries(
@pytest.mark.asyncio
@mock.patch(f"{TRIGGER_PATH}.hook")
- async def test_cleanup_does_not_delete_when_fired_event(self, mock_hook):
+ @mock.patch(f"{POD_TRIGGER_MODULE}.AIRFLOW_V_3_3_PLUS", True)
+ async def test_on_kill_does_not_delete_when_fired_event(self, mock_hook):
Review Comment:
Sure @jscheffl Will do this way.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move KubernetesPodTrigger pod cleanup from cleanup() to on_kill() [airflow]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #65741:
URL: https://github.com/apache/airflow/pull/65741#issuecomment-4307074486
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our [Contributors' Guide](https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:
- Pay attention to the quality of your code (ruff, mypy and type annotations). Our [prek-hooks]( https://github.com/apache/airflow/blob/main/contributing-docs/08_static_code_checks.rst#prerequisites-for-prek-hooks) will help you with that.
- In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/main/airflow-core/docs/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
- Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/dev/breeze/doc/README.rst) for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
- Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
- Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
- Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#coding-style-and-best-practices).
- Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
Apache Airflow is a community-driven project and together we are making it better 🚀.
In case of doubts contact the developers at:
Mailing List: dev@airflow.apache.org
Slack: https://s.apache.org/airflow-slack
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move KubernetesPodTrigger pod cleanup from cleanup() to on_kill() [airflow]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #65741:
URL: https://github.com/apache/airflow/pull/65741#discussion_r3140142798
##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/triggers/pod.py:
##########
@@ -411,17 +414,52 @@ async def get_task_state(self):
async def safe_to_cancel(self) -> bool:
"""
- Whether it is safe to cancel the external job which is being executed by this trigger.
+ Whether it is safe to delete the pod during trigger cleanup.
- Cancel is NOT safe when the task is still in DEFERRED state, because it means the
- triggerer is redistributing triggers and the trigger will be recreated on another triggerer.
- Cancel IS safe when the task state has changed (e.g. user marked it as success/failed).
+ Used only on Airflow < 3.3.0 where the triggerer does not invoke ``on_kill()`` for user kills.
+ Cancel is NOT safe when the task is still in DEFERRED state (triggerer restart).
Review Comment:
In `safe_to_cancel()` docstring the wording still refers to "Cancel" even though the method is now described as determining whether it's safe to *delete the pod* during cleanup. Please update the docstring language (e.g. "Deletion is NOT safe...") to match the updated semantics and avoid confusion with `on_kill()`.
```suggestion
Deletion is NOT safe when the task is still in DEFERRED state (triggerer restart).
```
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move KubernetesPodTrigger pod cleanup from cleanup() to on_kill() [airflow]
Posted by "raushanprabhakar1 (via GitHub)" <gi...@apache.org>.
raushanprabhakar1 commented on code in PR #65741:
URL: https://github.com/apache/airflow/pull/65741#discussion_r3145030277
##########
providers/cncf/kubernetes/tests/unit/cncf/kubernetes/triggers/test_pod.py:
##########
@@ -561,7 +562,8 @@ async def test__get_pod_retries(
@pytest.mark.asyncio
@mock.patch(f"{TRIGGER_PATH}.hook")
- async def test_cleanup_does_not_delete_when_fired_event(self, mock_hook):
+ @mock.patch(f"{POD_TRIGGER_MODULE}.AIRFLOW_V_3_3_PLUS", True)
+ async def test_on_kill_does_not_delete_when_fired_event(self, mock_hook):
Review Comment:
Hi @jscheffl , i have addressed your commments, please do review. Thanks
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move KubernetesPodTrigger pod cleanup from cleanup() to on_kill() [airflow]
Posted by "raushanprabhakar1 (via GitHub)" <gi...@apache.org>.
raushanprabhakar1 commented on PR #65741:
URL: https://github.com/apache/airflow/pull/65741#issuecomment-4332295767
Hi @jscheffl , fixed the lint issues. Thanks
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Move KubernetesPodTrigger pod cleanup from cleanup() to on_kill() [airflow]
Posted by "amoghrajesh (via GitHub)" <gi...@apache.org>.
amoghrajesh commented on code in PR #65741:
URL: https://github.com/apache/airflow/pull/65741#discussion_r3152005337
##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/triggers/pod.py:
##########
@@ -411,17 +414,50 @@ async def get_task_state(self):
async def safe_to_cancel(self) -> bool:
"""
- Whether it is safe to cancel the external job which is being executed by this trigger.
+ Whether it is safe to delete the pod during trigger cleanup.
- Cancel is NOT safe when the task is still in DEFERRED state, because it means the
- triggerer is redistributing triggers and the trigger will be recreated on another triggerer.
- Cancel IS safe when the task state has changed (e.g. user marked it as success/failed).
+ Used only on Airflow < 3.3.0 where the triggerer does not invoke ``on_kill()`` for user kills.
+ Deletion is NOT safe when the task is still in DEFERRED state (triggerer restart).
"""
task_state = await self.get_task_state()
return task_state != TaskInstanceState.DEFERRED
+ async def on_kill(self) -> None:
+ """
+ Delete the pod when the trigger is cancelled by a user action.
+
+ The triggerer invokes this for user-initiated kills on Airflow 3.3.0+ only; on older versions
+ use ``cleanup()`` and ``safe_to_cancel()`` instead.
+ """
+ if self._fired_event:
+ self.log.debug("Skipping on_kill since an event has already been fired.")
+ return
+
+ if self.on_kill_action == OnKillAction.KEEP_POD:
+ self.log.debug("Skipping on_kill since on_kill_action is set to %r.", self.on_kill_action.value)
+ return
+
+ self.log.info("Deleting pod %s in namespace %s.", self.pod_name, self.pod_namespace)
+ try:
+ await self.hook.delete_pod(
+ name=self.pod_name,
+ namespace=self.pod_namespace,
+ grace_period_seconds=self.termination_grace_period,
+ )
+ except Exception:
+ self.log.exception("Unexpected error while deleting pod %s", self.pod_name)
+
async def cleanup(self) -> None:
- """Clean up the pod when the trigger is cancelled."""
+ """
+ Clean up the pod when the trigger exits.
+
+ On Airflow 3.3.0+ pod deletion on user kill is handled in ``on_kill()`` only; this avoids
+ deleting pods on triggerer restart. On older Airflow versions, ``cleanup()`` still uses
+ ``safe_to_cancel()`` because ``on_kill()`` is not wired for user kills.
+ """
+ if AIRFLOW_V_3_3_PLUS:
+ return
Review Comment:
Can you add a todo in here mentioning to delete this branch once min version supported by provider is 3.3+? Similar to https://github.com/apache/airflow/pull/65740/changes#diff-05b0cb12b0dbb6b01c7a2733c7a1f99578ed6f4771dc4dfdf2d577593d6d967dR473-R476
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org