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

Conversation

pragnareddye
Copy link
Contributor

@pragnareddye pragnareddye commented Jul 2, 2023

This PR updates the PythonOperator section of the documentation to include information about how the LocalExecutor works when multiple Airflow Schedulers are in use.

In the updated documentation, I have added a note that explains:

Each Scheduler, when configured with executor = LocalExecutor, runs its own LocalExecutor. Tasks are processed in a distributed fashion across the machines running the Schedulers. It takes into consideration the scenario when a scheduler is restarted. It also explains the limitations on sharing of instances across tasks with multiple Schedulers. This information was not clear in the existing documentation, and this update should help users understand how LocalExecutor works in a multi-Scheduler setup.

closes: #26565
related: #26565


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

This PR updates the PythonOperator section of the documentation to include information about how the LocalExecutor works when multiple Airflow Schedulers are in use.

In the updated documentation, I have added a note that explains:

Each Scheduler, when configured with executor = LocalExecutor, runs its own LocalExecutor.
Tasks are processed in a distributed fashion across the machines running the Schedulers.
It takes into consideration the scenario when a scheduler is restarted.
It also explains the limitations on sharing of instances across tasks with multiple Schedulers.
This information was not clear in the existing documentation, and this update should help users understand how LocalExecutor works in a multi-Scheduler setup.
@pragnareddye pragnareddye requested a review from potiuk as a code owner July 2, 2023 06:32
@boring-cyborg boring-cyborg bot added area:core-operators Operators, Sensors and hooks within Core Airflow kind:documentation labels Jul 2, 2023
@@ -28,6 +28,16 @@ Use the ``@task`` decorator to execute Python callables.
The ``@task`` decorator is recommended over the classic :class:`~airflow.operators.python.PythonOperator`
to execute Python callables.

.. note::
Copy link
Member

Choose a reason for hiding this comment

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

Why here? It is importand and valid potint to mention but it works the same way for every other operator, so I guess it should be explained in https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/executor/local.html#local-executor

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@potiuk I missed that. I have made the changes in local.rst now. Let me know if that looks good

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@potiuk Updated now


.. 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

docs/apache-airflow/core-concepts/executor/local.rst Outdated Show resolved Hide resolved
@uranusjr uranusjr merged commit e53320d into apache:main Jul 5, 2023
@ephraimbuddy ephraimbuddy added the type:doc-only Changelog: Doc Only label Jul 6, 2023
@ephraimbuddy ephraimbuddy added this to the Airlfow 2.6.3 milestone Jul 6, 2023
ephraimbuddy pushed a commit that referenced this pull request Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core-operators Operators, Sensors and hooks within Core Airflow kind:documentation type:doc-only Changelog: Doc Only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documentation unclear about multiple LocalExecutors on HA Scheduler deployment
6 participants