I don't know anything about Airflow. Are you sure that each of these
tasks is running inside the same Python interpreter/process? I see
Airflow can distribute tasks among workers:
https://airflow.apache.org/docs/apache-airflow/stable/executor/index.html
This sounds like a problem that is going to be very specific to your
deployment environment. If you have multiple worker processes, you're
going to need some way to distribute the new password to each of the
workers (eg. a shared cache)
But regardless of that, you're still not following the pattern from
the documentation. I don't understand why you are creating a new
engine inside your do_connect handler. You should be creating a
cx-Oracle connection and returning it. The parameters passed to the
do_connect handler have already been parsed out of the connection
string. So for example, if your connection string includes a
"password=some_password" parameter, then cparams will have a
"password" key with the value "some_password". The same cparams
dictionary will be passed to the do_connect handler each time, so if
you mutate the dictionary (eg. by updating the "password" key), the
next call to the handler will contain the new value.
If each task invocation is creating a new engine using a connection
string that is out of date, then none of that will help you, but that
would be an Airflow problem, not an SQLAlchemy problem.
Simon
> To view this discussion on the web visit
https://groups.google.com/d/msgid/sqlalchemy/136a743f-e4fb-4cde-b363-9af7670057b8n%40googlegroups.com.