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/12/14 10:35:17 UTC

[GitHub] [airflow] ashb opened a new pull request #13057: Explicitly shutdown logging in tasks so concurrent.futures can be used

ashb opened a new pull request #13057:
URL: https://github.com/apache/airflow/pull/13057


   This fixes three problems:
   
   1. That remote logs weren't being uploaded due to the fork change
   2. That the S3 hook attempted to fetch credentials from the DB, but the
      ORM had already been disposed.
   3. That even if forking was disabled, that S3 logs would fail due to use
      of concurrent.futures. See https://bugs.python.org/issue33097
   
   Fixes #12969
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/master/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/master/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.

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



[GitHub] [airflow] potiuk commented on pull request #13057: Explicitly shutdown logging in tasks so concurrent.futures can be used

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


   The latest fixup works for Local Executor :+1: 
   
   Still when I set `RFLOW__CORE__EXECUTE_TASKS_NEW_PYTHON_INTERPRETER=True` I got:
   
   ```
   ERROR - Could not write logs to s3://test-amazon-logging/airflowlogs/example_bash_operator/run_after_loop/2020-12-14T13:45:22.539172+00:00/1.log                                                                                                       
   Traceback (most recent call last):
     File "/usr/local/lib/python3.8/site-packages/airflow/providers/amazon/aws/log/s3_task_handler.py", line 201, in s3_write
       self.hook.load_string(
     File "/usr/local/lib/python3.8/site-packages/airflow/providers/amazon/aws/hooks/s3.py", line 57, in wrapper
       connection = self.get_connection(self.aws_conn_id)
     File "/usr/local/lib/python3.8/site-packages/airflow/hooks/base.py", line 63, in get_connection
       conn = Connection.get_connection_from_secrets(conn_id)
     File "/usr/local/lib/python3.8/site-packages/airflow/models/connection.py", line 351, in get_connection_from_secrets
       conn = secrets_backend.get_connection(conn_id=conn_id)
     File "/usr/local/lib/python3.8/site-packages/airflow/utils/session.py", line 64, in wrapper
       with create_session() as session:
     File "/usr/local/lib/python3.8/contextlib.py", line 113, in __enter__
       return next(self.gen)
     File "/usr/local/lib/python3.8/site-packages/airflow/utils/session.py", line 29, in create_session
       session = settings.Session()
   TypeError: 'NoneType' object is not callable
   ```
   


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



[GitHub] [airflow] potiuk edited a comment on pull request #13057: Explicitly shutdown logging in tasks so concurrent.futures can be used

Posted by GitBox <gi...@apache.org>.
potiuk edited a comment on pull request #13057:
URL: https://github.com/apache/airflow/pull/13057#issuecomment-744455560


   The latest fixup works for Local Executor :+1: 
   
   Still when I set `AIRFLOW__CORE__EXECUTE_TASKS_NEW_PYTHON_INTERPRETER=True` I got:
   
   ```
   ERROR - Could not write logs to s3://test-amazon-logging/airflowlogs/example_bash_operator/run_after_loop/2020-12-14T13:45:22.539172+00:00/1.log                                                                                                       
   Traceback (most recent call last):
     File "/usr/local/lib/python3.8/site-packages/airflow/providers/amazon/aws/log/s3_task_handler.py", line 201, in s3_write
       self.hook.load_string(
     File "/usr/local/lib/python3.8/site-packages/airflow/providers/amazon/aws/hooks/s3.py", line 57, in wrapper
       connection = self.get_connection(self.aws_conn_id)
     File "/usr/local/lib/python3.8/site-packages/airflow/hooks/base.py", line 63, in get_connection
       conn = Connection.get_connection_from_secrets(conn_id)
     File "/usr/local/lib/python3.8/site-packages/airflow/models/connection.py", line 351, in get_connection_from_secrets
       conn = secrets_backend.get_connection(conn_id=conn_id)
     File "/usr/local/lib/python3.8/site-packages/airflow/utils/session.py", line 64, in wrapper
       with create_session() as session:
     File "/usr/local/lib/python3.8/contextlib.py", line 113, in __enter__
       return next(self.gen)
     File "/usr/local/lib/python3.8/site-packages/airflow/utils/session.py", line 29, in create_session
       session = settings.Session()
   TypeError: 'NoneType' object is not callable
   ```
   


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



[GitHub] [airflow] github-actions[bot] commented on pull request #13057: Explicitly shutdown logging in tasks so concurrent.futures can be used

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


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

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



[GitHub] [airflow] potiuk edited a comment on pull request #13057: Explicitly shutdown logging in tasks so concurrent.futures can be used

Posted by GitBox <gi...@apache.org>.
potiuk edited a comment on pull request #13057:
URL: https://github.com/apache/airflow/pull/13057#issuecomment-744478065


   That's where System Tests are so handy - none of our unit tests detected it, because we are mocking those SSL calls out.


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



[GitHub] [airflow] potiuk commented on pull request #13057: Explicitly shutdown logging in tasks so concurrent.futures can be used

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


   > > > The logs were uploaded correctly for me on S3 but had issues when viewing logs on the Webserver due to `snowflake-connector-python` library (the same incompatibility as documented in #13056)
   > > > However, after uninstalling it, everything works fine
   > > 
   > > 
   > > Yeah - That's the reason I added #13056 and It makes me think that we should re-release providers to rc2 with this INFO added to readmes
   > 
   > I'd rather we released all the other ones and just made amazon a 1.0.1. A doc only change doesn't really warrant failing the vote I feel.
   
   It's also presto and I believe a bunch of others (I am looking at urrlib3 usage just now). 
   
   But I agree it's not critical, I doubt people will be installing snowflake an-masse (and for sure we should release snowflake with the warning in).
   
   


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



[GitHub] [airflow] potiuk commented on pull request #13057: Explicitly shutdown logging in tasks so concurrent.futures can be used

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


   Also https://github.com/apache/airflow/pull/13062 is coming - it already started hitting the development efforts and system tests for GCP are failing with this one (so I think snowflake + google also does not work).


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



[GitHub] [airflow] kaxil commented on pull request #13057: Explicitly shutdown logging in tasks so concurrent.futures can be used

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


   I am going to merge this since all 3 of us have tested it individually


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



[GitHub] [airflow] potiuk commented on pull request #13057: Explicitly shutdown logging in tasks so concurrent.futures can be used

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


   > The logs were uploaded correctly for me on S3 but had issues when viewing logs on the Webserver due to `snowflake-connector-python` library (the same incompatibility as documented in #13056)
   > 
   > However, after uninstalling it, everything works fine
   
   Yeah - That's the reason  I added https://github.com/apache/airflow/pull/13056 and It makes me think that we should re-release providers to rc2 with this INFO added to readmes


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



[GitHub] [airflow] potiuk commented on pull request #13057: Explicitly shutdown logging in tasks so concurrent.futures can be used

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


   That's where System Tests are so handy - none of our unit tests detected it, because we are mocking those out.


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



[GitHub] [airflow] potiuk edited a comment on pull request #13057: Explicitly shutdown logging in tasks so concurrent.futures can be used

Posted by GitBox <gi...@apache.org>.
potiuk edited a comment on pull request #13057:
URL: https://github.com/apache/airflow/pull/13057#issuecomment-744478065


   That's where System Tests are so handy - none of our unit tests detected it, because we are mocking those SSL calls out (only the integration test we had Kerberos + Presto + SSL detected it in our Integration tests).


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



[GitHub] [airflow] kaxil merged pull request #13057: Explicitly shutdown logging in tasks so concurrent.futures can be used

Posted by GitBox <gi...@apache.org>.
kaxil merged pull request #13057:
URL: https://github.com/apache/airflow/pull/13057


   


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



[GitHub] [airflow] ashb commented on pull request #13057: Explicitly shutdown logging in tasks so concurrent.futures can be used

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


   > > The logs were uploaded correctly for me on S3 but had issues when viewing logs on the Webserver due to `snowflake-connector-python` library (the same incompatibility as documented in #13056)
   > > However, after uninstalling it, everything works fine
   > 
   > Yeah - That's the reason I added #13056 and It makes me think that we should re-release providers to rc2 with this INFO added to readmes
   
   I'd rather we released all the other ones and just made amazon a 1.0.1. A doc only change doesn't really warrant failing the vote I feel.


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



[GitHub] [airflow] kaxil commented on pull request #13057: Explicitly shutdown logging in tasks so concurrent.futures can be used

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


   The logs were uploaded correctly for me on S3 but had issues when viewing logs on the Webserver due to `snowflake-connector-python` library (the same incompatibility as documented in https://github.com/apache/airflow/pull/13056)
   
   However, after uninstalling it, everything works fine
   
   ![image](https://user-images.githubusercontent.com/8811558/102091158-5b7c2f80-3e16-11eb-8014-a65d4cf40de1.png)
   


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



[GitHub] [airflow] potiuk commented on pull request #13057: Explicitly shutdown logging in tasks so concurrent.futures can be used

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


   > Also #13062 is coming - it already started hitting the development efforts and system tests for GCP are failing with this one (so I think snowflake + google also does not work).
   
   Yep. Google cloud storage at least :(


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