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/29 13:11:15 UTC

[GitHub] [airflow] kaxil commented on pull request #19842: Avoid littering postgres server logs with "could not obtain lock" with HA schedulers

kaxil commented on pull request #19842:
URL: https://github.com/apache/airflow/pull/19842#issuecomment-981620635


   Hmm tests are failing:
   
   ```
    INFO  [alembic.runtime.migration] Running upgrade 7b2661a43ba3 -> be2bfac3da23, Add has_import_errors column to DagModel
     WARNI [airflow.models.crypto] empty cryptography key - values will not be stored encrypted.
     Traceback (most recent call last):
       File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
         cursor, statement, parameters, context
       File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
         cursor.execute(statement, parameters)
     psycopg2.errors.LockNotAvailable: canceling statement due to lock timeout
     
     
     The above exception was the direct cause of the following exception:
     
     Traceback (most recent call last):
       File "/opt/airflow/airflow/utils/db.py", line 1017, in create_global_lock
         conn.execute(text('SELECT pg_advisory_lock(:id)'), id=lock.value)
       File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
         return meth(self, multiparams, params)
       File "/usr/local/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
         return connection._execute_clauseelement(self, multiparams, params)
       File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1130, in _execute_clauseelement
         distilled_params,
       File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1317, in _execute_context
         e, statement, parameters, cursor, context
       File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1511, in _handle_dbapi_exception
         sqlalchemy_exception, with_traceback=exc_info[2], from_=e
       File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
         raise exception
       File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
         cursor, statement, parameters, context
       File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
         cursor.execute(statement, parameters)
     sqlalchemy.exc.OperationalError: (psycopg2.errors.LockNotAvailable) canceling statement due to lock timeout
     
     [SQL: SELECT pg_advisory_lock(%(id)s)]
     [parameters: {'id': 1}]
     (Background on this error at: http://sqlalche.me/e/13/e3q8)
     
     During handling of the above exception, another exception occurred:
     
     Traceback (most recent call last):
       File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
         cursor, statement, parameters, context
       File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
         cursor.execute(statement, parameters)
     psycopg2.errors.InFailedSqlTransaction: current transaction is aborted, commands ignored until end of transaction block
     
     
     The above exception was the direct cause of the following exception:
     
     Traceback (most recent call last):
       File "/usr/local/bin/airflow", line 33, in <module>
         sys.exit(load_entry_point('apache-airflow', 'console_scripts', 'airflow')())
       File "/opt/airflow/airflow/__main__.py", line 48, in main
         args.func(args)
       File "/opt/airflow/airflow/cli/cli_parser.py", line 48, in command
         return func(*args, **kwargs)
       File "/opt/airflow/airflow/cli/commands/db_command.py", line 39, in resetdb
         db.resetdb()
       File "/opt/airflow/airflow/utils/session.py", line 69, in wrapper
         return func(*args, session=session, **kwargs)
       File "/opt/airflow/airflow/utils/db.py", line 932, in resetdb
         initdb(session=session)
       File "/opt/airflow/airflow/utils/session.py", line 66, in wrapper
         return func(*args, **kwargs)
       File "/opt/airflow/airflow/utils/db.py", line 599, in initdb
         with create_global_lock(session=session, lock=DBLocks.MIGRATIONS):
       File "/usr/local/lib/python3.7/contextlib.py", line 112, in __enter__
         return next(self.gen)
       File "/opt/airflow/airflow/utils/db.py", line 1030, in create_global_lock
         conn.execute('SET LOCK_TIMEOUT TO DEFAULT')
       File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1003, in execute
         return self._execute_text(object_, multiparams, params)
       File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1178, in _execute_text
         parameters,
       File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1317, in _execute_context
         e, statement, parameters, cursor, context
       File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1511, in _handle_dbapi_exception
         sqlalchemy_exception, with_traceback=exc_info[2], from_=e
       File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
         raise exception
       File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
         cursor, statement, parameters, context
       File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
         cursor.execute(statement, parameters)
     sqlalchemy.exc.InternalError: (psycopg2.errors.InFailedSqlTransaction) current transaction is aborted, commands ignored until end of transaction block
     
     [SQL: SET LOCK_TIMEOUT TO DEFAULT]
     (Background on this error at: http://sqlalche.me/e/13/2j85)
   ```


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