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:59:59 UTC

[GitHub] [airflow] ashb commented on a change in pull request #11372: Reduce "start-up" time for tasks in CeleryExecutor

ashb commented on a change in pull request #11372:
URL: https://github.com/apache/airflow/pull/11372#discussion_r502378199



##########
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:
       Can't cos of the `logging.shutdown()` at the end of task_run (which we need to keep, as that's when remote logs are uploaded. https://github.com/apache/airflow/pull/11327#issuecomment-705139313




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