kaxil edited a comment on issue #13099:
URL: https://github.com/apache/airflow/issues/13099#issuecomment-767163927


   > Happy New Year @ashb
   > There is a little bit of both. There is an outstanding issue where use of 
Variables (or probably anything that interacts with the backed db in the global 
scope) in a plugin raises the `UNEXPECTED COMMIT` RunTime error.
   > The problem I reported with being unable to restart the scheduler seems to 
have been caused by wrapping my `Variable.get` in an overly generous 
try/except, hiding the run time error and causing things in the db to get out 
of sync.
   > Running the below should recreate the issue, I did this on python 3.7
   > 
   > ```
   > mkdir airflow_scheduler_test
   > cd airflow_scheduler_test
   > export AIRFLOW_HOME=$(pwd)
   > virtualenv pyenv 
   > source pyenv/bin/activate
   > pip install apache-airflow==2.0.0
   > 
   > airflow db init
   > airflow variables set test TEST
   > mkdir plugins
   > cat << EOF > plugins/test.py
   > from airflow.models.variable import Variable
   > 
   > print(Variable.get('test'))
   > EOF
   > 
   > airflow dags unpause example_bash_operator
   > airflow scheduler
   > ```
   
   I was not able to reproduce it with Postgres 9.6 and 12, haven't tried it 
with 13.1
   
   


----------------------------------------------------------------
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:
[email protected]


Reply via email to