You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/10/09 11:50:15 UTC
[GitHub] [airflow] turbaszek commented on a change in pull request #11372: Reduce "start-up" time for tasks in CeleryExecutor
turbaszek commented on a change in pull request #11372:
URL: https://github.com/apache/airflow/pull/11372#discussion_r502373478
##########
File path: airflow/executors/celery_executor.py
##########
@@ -78,6 +80,45 @@ def execute_command(command_to_exec: CommandType) -> None:
"""Executes command."""
BaseExecutor.validate_command(command_to_exec)
log.info("Executing command in Celery: %s", command_to_exec)
+
+ if settings.EXECUTE_TASKS_NEW_PYTHON_INTERPRETER:
+ _execute_in_subprocees(command_to_exec)
+ else:
+ _execute_in_fork(command_to_exec)
+
+
+def _execute_in_fork(command_to_exec: CommandType) -> None:
+ pid = os.fork()
Review comment:
Do we need to fork it? Shouldn't we just execute it in current process (celery worker process)?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org