dstandish commented on PR #38946: URL: https://github.com/apache/airflow/pull/38946#issuecomment-2052055735
> Just one question here - I understand that this one is to allow "run task" CLI command to store things in the DB ? Do I understand correctly that it means that we currently open 1 more DB session from the worker when we run the task to store the Log in the the DB? before the _run_raw_task gets one? > That might be a potential for optimization in general if I understand correctly ? this is used by the `@action_cli` decorator to log all cli commands as events in `Log` table. Since airflow worker runs tasks with CLI yeah I think it does open a session for that. It also is invoked when the celery worker starts. But, the session is short lived I believe, only for the length of time it takes to log that event. IT starts running the task after that I think. But it might be 2x for each task run since we do `--local` and `--raw` in subprocess I think -- that part is a bit confusing. We also create a session when rendering log template for the task. This is another thing that probably we could get rid of with some thinking and def should be fixed for 3.0. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
