Comments (4)
This traceback shows error happens when django are acquiring database connection while database connection pool was empty. this means this is the first time to try connecting to your database,
I don't think it is a good idea to retry connecting by django-db-connection-pool or SQLAlchemy while pool is still empty, you should catch OperationalErrors in your code.
PS:
Assume after invoking creator (dj_db_conn_pool.core.mixins.PooledDatabaseWrapperMixin._get_new_connection), SQLAlchemy receives dbapi connection successfully, If django requires database connection again, SQLAlchemy will try to get a DBAPI connection from the pool, if this connection was abnormal, SQLAlchemy will make three attempts to re-connect to database.
from django-db-connection-pool.
I don't think it is a good idea to retry connecting by django-db-connection-pool or SQLAlchemy while pool is still empty, you should catch OperationalErrors in your code.
Ok. While there still might be a transitional error in this case (so that it might help to retry), it is not that much an issue then.
Thanks for the additional explanation!
from django-db-connection-pool.
Well, after all it happens with every new connection, not just the first one / if the pool is empty, doesn't it?
from django-db-connection-pool.
Well, after all it happens with every new connection, not just the first one / if the pool is empty, doesn't it?
"pool is empty" has two states:
- no connections has been checked-out from pool, in this case, the pool has just been created, it's empty
- all connections in the pool has been checked-out, the pool is also empty
while "pool is empty", If the limit of pool is not exceeded, SQLAlchemy will make a new connection.
- SQLAlchemy doesn't retry if new connection fails: code
- SQLAlchemy checks connection got from pool, if connection is abnormal, three reconnection attempts will be made at maximum: code
from django-db-connection-pool.
Related Issues (20)
- postgresl无法正常插入或更新数据库 HOT 1
- New release? HOT 1
- 2006, 'MySQL server has gone away' 2013, 'Lost connection to MySQL server during query HOT 3
- save does not committing when using pool HOT 4
- dj_db_conn_pool make migrations HOT 1
- Install: pg_config executable not found. HOT 1
- django 连接oceanbase Mysql租户,make migrantions 失败, HOT 5
- I am already using a custom engine -- geodjango -- how can I also use django-db-connection-pool? HOT 1
- Test case run fails with the documented setup HOT 3
- OperationalError SSL SYSCALL error: EOF detected HOT 3
- The _ConnectionFairy.connection attribute is deprecated HOT 2
- Django 4.2 incompatibility HOT 1
- 1.2.3 is broken. HOT 4
- ORA-01036: illegal variable name/number HOT 1
- Django doesnt respect the pool configuration when using "gevent" class HOT 4
- dj_db_conn_pool.backends.postgis problem with python manage.py CMD HOT 3
- Postgis backend broken (python 3.12.1, django==5.0.1, psycopg[binary,pool]==3.1.17, sqlalchemy==2.0.25) HOT 1
- Does not detects psycopg[binary]. Tries to install psycopg2[binary]. HOT 2
- What is the difference between this and pgbouncer / other connection pooling alternatives? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-db-connection-pool.