steveahnahn commented on code in PR #69635:
URL: https://github.com/apache/airflow/pull/69635#discussion_r3652682091
##########
providers/snowflake/src/airflow/providers/snowflake/triggers/snowflake_trigger.py:
##########
@@ -93,6 +101,27 @@ async def run(self) -> AsyncIterator[TriggerEvent]:
except Exception as e:
yield TriggerEvent({"status": "error", "message": str(e)})
+ async def on_kill(self) -> None:
+ """Cancel the running Snowflake queries when the user kills the
deferred task."""
+ if not self.cancel_on_kill or not self.query_ids:
+ return
+ self.log.info("Cancelling Snowflake query ids %s", self.query_ids)
+ try:
+ await sync_to_async(self._cancel_queries)()
Review Comment:
Good call, extended the on_kill docstring to name the knob: cancellation
issues one blocking request per query id, so a task with many statements
against a slow warehouse can exceed on_kill_timeout and statements not
cancelled within that budget may keep running
--
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]