Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion airflow-core/docs/core-concepts/executor/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ The ``BaseExecutor`` class interface contains a set of attributes that Airflow c
* ``is_single_threaded``: Whether or not the executor is single threaded. This is particularly relevant to what database backends are supported. Single threaded executors can run with any backend, including SQLite.
* ``is_production``: Whether or not the executor should be used for production purposes. A UI message is displayed to users when they are using a non-production ready executor.

* ``change_sensor_mode_to_reschedule``: Running Airflow sensors in poke mode can block the thread of executors and in some cases Airflow.
* ``serve_logs``: Whether or not the executor supports serving logs, see :doc:`/administration-and-deployment/logging-monitoring/logging-tasks`.

CLI
Expand Down
1 change: 0 additions & 1 deletion airflow-core/src/airflow/executors/base_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ class BaseExecutor(LoggingMixin):
is_local: bool = False
is_production: bool = True

change_sensor_mode_to_reschedule: bool = False
serve_logs: bool = False

job_id: None | int | str = None
Expand Down
6 changes: 1 addition & 5 deletions airflow-core/src/airflow/ti_deps/deps/ready_to_reschedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@ def _get_dep_statuses(self, ti, session, dep_context):
if (
# Mapped sensors don't have the reschedule property (it can only be calculated after unmapping),
# so we don't check them here. They are handled below by checking TaskReschedule instead.
not is_mapped
and not getattr(ti.task, "reschedule", False)
# Executors can force running in reschedule mode,
# in which case we ignore the value of the task property.
and not executor.change_sensor_mode_to_reschedule
not is_mapped and not getattr(ti.task, "reschedule", False)
):
yield self._passing_status(reason="Task is not in reschedule mode.")
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ class CeleryKubernetesExecutor(BaseExecutor):
is_production: bool = True

serve_logs: bool = False
change_sensor_mode_to_reschedule: bool = False

callback_sink: BaseCallbackSink | None = None

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class LocalKubernetesExecutor(BaseExecutor):
is_production: bool = True

serve_logs: bool = True
change_sensor_mode_to_reschedule: bool = False

callback_sink: BaseCallbackSink | None = None

Expand Down
14 changes: 0 additions & 14 deletions task-sdk/src/airflow/sdk/bases/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@
TaskDeferralError,
TaskDeferralTimeout,
)
from airflow.executors.executor_loader import ExecutorLoader
from airflow.sdk.bases.operator import BaseOperator
from airflow.utils import timezone

if TYPE_CHECKING:
from airflow.sdk.definitions.context import Context
from airflow.typing_compat import Self


class PokeReturnValue:
Expand Down Expand Up @@ -326,18 +324,6 @@ def _get_next_poke_interval(
self.log.info("new %s interval is %s", self.mode, new_interval)
return new_interval

def prepare_for_execution(self) -> Self:
task = super().prepare_for_execution()

# Sensors in `poke` mode can block execution of DAGs when running
# with single process executor, thus we change the mode to`reschedule`
# to allow parallel task being scheduled and executed
executor, _ = ExecutorLoader.import_default_executor_cls()
if executor.change_sensor_mode_to_reschedule:
self.log.warning("%s changes sensor mode to 'reschedule'.", executor.__name__)
task.mode = "reschedule"
return task

@property
def reschedule(self):
"""Define mode rescheduled sensors."""
Expand Down