While executing query in Python on oracle database with cx_oracle=8.3.0, with sqlalchemy=1.4.0 and instantclient=21.11 I am getting multiple "ORA-03106: fatal two-task communication protocol error" and sometimes intermittently "WARN exited: gunicorn (terminated by SIGSEGV; not expected)" logs SIGSEGV leads to application restarts.
This error occurs randomly in any query
I am running 3 worker process and using db connection pool as below:
import sqlalchemy as db
__crm_engine= None
def get_con():
if __crm_engine is None:
__crm_engine = db.create_engine(db_string, pool_size=10, pool_pre_ping=True )
con = __crm_engine.connect()
return con
In master process the connection of db is created and before starting app in wsgi I am running dispose db connection like this :
def start():
app= setup_flask()
dispose_db_connection_pool()
return app
app = start()
def dispose_db_connection_pool():
__crm_engine.pool = __crm_engine.pool.recreate()
Is this correct way to dispose connection pool before worker is fork? Will new worker serve with new db connection or same as that of parent.
any lead will be helpful. Thanks in Advance
- I tried upgrading oracle client, Sqlalchemy.
- Disabled statement cache.
Above did not helped.