Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update python.rst with multi-Scheduler LocalExecutor info #32310

Merged
merged 15 commits into from
Jul 5, 2023
11 changes: 11 additions & 0 deletions docs/apache-airflow/core-concepts/executor/local.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,14 @@ Arguably, :class:`~airflow.executors.sequential_executor.SequentialExecutor` cou
parallelism of just 1 worker, i.e. ``self.parallelism = 1``.
This option could lead to the unification of the executor implementations, running
locally, into just one :class:`~airflow.executors.local_executor.LocalExecutor` with multiple modes.

.. note::

When using the ``@task`` decorator with multiple Schedulers configured with ``executor = LocalExecutor`` in the [core] section of airflow.cfg, each scheduler will run a LocalExecutor. This means tasks would be processed in a distributed fashion across the machines running the Schedulers.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this apply only when using the @task decorator? Or it is a general behaviour. If general, can we remove the leading part of the sentence which mentions about the case for @task decorator?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that it is general

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pankajkoti Updated and done

pragnareddye marked this conversation as resolved.
Show resolved Hide resolved

Some considerations should be taken into account:

- Restarting a Scheduler: If a scheduler is restarted, it may take some time for other schedulers to recognize the orphaned tasks and restart or fail them.

uranusjr marked this conversation as resolved.
Show resolved Hide resolved
- Sharing of instances: While a single LocalExecutor allows tasks to share the same Python process and exchange information via variables, this is not possible when using multiple Schedulers, as each Scheduler will run in its own separate Python process.
potiuk marked this conversation as resolved.
Show resolved Hide resolved