o-nikolas commented on code in PR #55743: URL: https://github.com/apache/airflow/pull/55743#discussion_r2356069997
########## airflow-core/docs/howto/sla-to-deadlines.rst: ########## @@ -0,0 +1,89 @@ + .. Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + .. http://www.apache.org/licenses/LICENSE-2.0 + + .. Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +Migrating from SLA to Deadline Alerts +===================================== + +Two different paradigms Review Comment: I think you'd gone with caps titles in the other docs. ```suggestion Two Different Paradigms ``` ########## airflow-core/docs/howto/sla-to-deadlines.rst: ########## @@ -0,0 +1,89 @@ + .. Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + .. http://www.apache.org/licenses/LICENSE-2.0 + + .. Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +Migrating from SLA to Deadline Alerts +===================================== + +Two different paradigms +----------------------- + +While the goal of the **SLA** and **Deadlines** features are very similar, they use two very different approaches +which makes it difficult to present a universal migration guide. Instead, this guide will lay out the major +differences and help you decide on the best approach for your use case. + +To begin with, we'll start by explaining the two approaches then go into how to find the right Deadline for your use case. + +SLA +^^^ + +When the dag run **finishes**, check the current time. If the time is greater than (logical_date + sla) then +execute ``sla_miss_callback``. If the Dag run never finishes, the SLA is never checked. + +Deadlines +^^^^^^^^^ + +When a Dag run **starts**, calculate and store (:ref:`DeadlineReference <built-in-deadline-references>` + interval). +Every pass of the scheduler loop (default 5 seconds, set by ``scheduler_heartbeat_sec``) if any of those times have +passed then execute ``callback(**kwargs)``. Review Comment: Suggestion, feel free to ignore. ```suggestion The scheduler loop then periodically checks (default 5 seconds, set by ``scheduler_heartbeat_sec``) if any of those times have passed then execute ``callback(**kwargs)``. ``` ########## airflow-core/docs/howto/sla-to-deadlines.rst: ########## @@ -0,0 +1,89 @@ + .. Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + .. http://www.apache.org/licenses/LICENSE-2.0 + + .. Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +Migrating from SLA to Deadline Alerts +===================================== + +Two different paradigms +----------------------- + +While the goal of the **SLA** and **Deadlines** features are very similar, they use two very different approaches Review Comment: Match the name in the title for the first usage? ```suggestion While the goal of the **SLA** and **Deadline Alerts** features are very similar, they use two very different approaches ``` ########## task-sdk/src/airflow/sdk/definitions/dag.py: ########## @@ -335,7 +335,8 @@ class DAG: beyond this the scheduler will disable the DAG :param dagrun_timeout: Specify the duration a DagRun should be allowed to run before it times out or fails. Task instances that are running when a DagRun is timed out will be marked as skipped. - :param sla_miss_callback: DEPRECATED - The SLA feature is removed in Airflow 3.0, to be replaced with a new implementation in 3.1 + :param sla_miss_callback: DEPRECATED - The SLA feature is removed in Airflow 3.0, to be replaced with DeadlineAlerts in 3.1 + :param deadline: An optional DeadlineAlert for the Dag. Review Comment: Are these changes meant to be in this docs PR? ########## airflow-core/docs/howto/sla-to-deadlines.rst: ########## @@ -0,0 +1,89 @@ + .. Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + .. http://www.apache.org/licenses/LICENSE-2.0 + + .. Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +Migrating from SLA to Deadline Alerts +===================================== + +Two different paradigms +----------------------- + +While the goal of the **SLA** and **Deadlines** features are very similar, they use two very different approaches +which makes it difficult to present a universal migration guide. Instead, this guide will lay out the major Review Comment: Don't under sell yourself in the docs. I know you want a hedge, but I think it sounds more official and trustworthy if we don't IMHO. ```suggestion While the goal of the **SLA** and **Deadline Alerts** features are very similar, they use two very different approaches, this guide will lay out the major ``` -- 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]
