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 2021/11/16 16:34:42 UTC

[GitHub] [airflow] khalidmammadov opened a new pull request #19624: Enable task run setting to be able reinitialise

khalidmammadov opened a new pull request #19624:
URL: https://github.com/apache/airflow/pull/19624


   When task is executed using "StandardTaskRunner._start_by_exec()" (when fork is not available) it's using old DONOT_MODIFY_HANDLERS config variable loaded during settings.py load and not the one from externally supplied --cfg-path    param
   
   **TL;DR**
   
   When "tasks run" command is executed it then internally re-executed as below command using external process (non fork when it's not available).
   ```[2021-11-16 15:28:16,818] {base_task_runner.py:144} INFO - Running: ['airflow', 'tasks', 'run', 'test_logging_dag', 'test_task', 'test_run', '--job-id', '102', '--raw', '--subdir', 'DAGS_FOLDER', '--cfg-path', '/tmp/tmpfv4cj9py', '--error-file', '/tmp/tmphjtaj5gi']  ```
   
   Here `'--cfg-path', '/tmp/tmpfv4cj9py'` is a copy of active config settings of parent process. When command is executed settings.py file is loaded as one of the first things but external config (/tmp/tmpfv4cj9py) is load later within task_command.py->def task_run. 
   And when it does load it does not re-initialize this setting. 
   This causes DONOT_MODIFY_HANDLERS to be initialized to a default value rather than one that is defined in the /tmp/tmpfv4cj9py
   The PR fixes it by moving initialization into settings.py/configure_vars function where it can be called when needed.
   
   PS:
   I think this issue is not limited to this variable but all other similar GLOBAL variables that is initialized during settings.py load. 
   But I think we need to check each of them separately before making similar changes.
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/main/UPDATING.md).
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] uranusjr commented on a change in pull request #19624: Enable task run setting to be able reinitialise

Posted by GitBox <gi...@apache.org>.
uranusjr commented on a change in pull request #19624:
URL: https://github.com/apache/airflow/pull/19624#discussion_r750963609



##########
File path: airflow/settings.py
##########
@@ -73,6 +73,7 @@
 SQL_ALCHEMY_CONN: Optional[str] = None
 PLUGINS_FOLDER: Optional[str] = None
 LOGGING_CLASS_PATH: Optional[str] = None
+DONOT_MODIFY_HANDLERS: Optional[str] = None

Review comment:
       Why is this annotated as str?




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk closed pull request #19624: Enable task run setting to be able reinitialise

Posted by GitBox <gi...@apache.org>.
potiuk closed pull request #19624:
URL: https://github.com/apache/airflow/pull/19624


   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] khalidmammadov commented on pull request #19624: Enable task run setting to be able reinitialise

Posted by GitBox <gi...@apache.org>.
khalidmammadov commented on pull request #19624:
URL: https://github.com/apache/airflow/pull/19624#issuecomment-974831863


   FYI: I am now using this PR to debug CI failures. Once done will file a new one for the original purpose


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] khalidmammadov commented on pull request #19624: Enable task run setting to be able reinitialise

Posted by GitBox <gi...@apache.org>.
khalidmammadov commented on pull request #19624:
URL: https://github.com/apache/airflow/pull/19624#issuecomment-980281682


   Closing to open a new one as this got a bit messy due to debug


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] khalidmammadov commented on pull request #19624: Enable task run setting to be able reinitialise

Posted by GitBox <gi...@apache.org>.
khalidmammadov commented on pull request #19624:
URL: https://github.com/apache/airflow/pull/19624#issuecomment-972890033


   @potiuk  can you please add "debug-ci-resources" label on this? 
   I think the failures are memory related


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #19624: Enable task run setting to be able reinitialise

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #19624:
URL: https://github.com/apache/airflow/pull/19624#issuecomment-972590359


   The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] khalidmammadov commented on a change in pull request #19624: Enable task run setting to be able reinitialise

Posted by GitBox <gi...@apache.org>.
khalidmammadov commented on a change in pull request #19624:
URL: https://github.com/apache/airflow/pull/19624#discussion_r751290151



##########
File path: airflow/settings.py
##########
@@ -73,6 +73,7 @@
 SQL_ALCHEMY_CONN: Optional[str] = None
 PLUGINS_FOLDER: Optional[str] = None
 LOGGING_CLASS_PATH: Optional[str] = None
+DONOT_MODIFY_HANDLERS: Optional[str] = None

Review comment:
       good spot! it must be bool




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] khalidmammadov commented on pull request #19624: Enable task run setting to be able reinitialise

Posted by GitBox <gi...@apache.org>.
khalidmammadov commented on pull request #19624:
URL: https://github.com/apache/airflow/pull/19624#issuecomment-974831863


   FYI: I am now using this PR to debug CI failures. Once done will file a new one for the original purpose


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #19624: Enable task run setting to be able reinitialise

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #19624:
URL: https://github.com/apache/airflow/pull/19624#issuecomment-973042989


   Added/closed/reopened to retest


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] khalidmammadov closed pull request #19624: Enable task run setting to be able reinitialise

Posted by GitBox <gi...@apache.org>.
khalidmammadov closed pull request #19624:
URL: https://github.com/apache/airflow/pull/19624


   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org