Comments (3)
Hi
Currently I can't go all out investigating it, will look further into in on weekend.
From what I managed to see right now:
postgresql just hangs around and waits for something
Problem seems to be that connections in pool ends and test hangs up waiting for connection to be released. So the problem is why they are not released by previous tests?
some operations, such as .update use the connection very differently than .filter Why do we have code sections that reserve a single connection? and some that dont?
The thing is .filter
doesn't make a query itself, it just prepares values for it. Actual query is made by executor class, and it was meant that all execute methods in executor should reserve single connection for all of a query. You can see that it is reserved in execute_select
the same way it is reserved in execute_update
. That was made exactly because of problems with pool I had in the initial stage of project, when recursive operations just took all of the connections from pool and it hang up the same way, waiting for connection to be released, never aquiring it, because upper level query was waiting for recursive queries to be done.
I think bug should be somewhere there, may be some part of code doesn't honour this idea and just takes fresh connection from the pool, so because of it subsequent query in a transaction doesn't see the prior changes made in the transaction
.
Also - may be we can see this problem because green
running multiply tests concurrently and different tests hang up on middle because all connections are already taken, but even if it is this way, the bug is still there because query should be able to finish itself within one connection and releasing it after finish
from tortoise-orm.
I already checked green
and single process, definitely not that.
Yes, I was talking of how execute_select
reserved a single connection, and how UpdateQuery
does not.
Also the whole transaction set was re-worked recently, and it is likely that due to changes in behaviour there we broke pooling (or rather I broke it unwittingly).
I feel that the grabbing of a single connection seems... over-complicating things. Likely we don't understand the real issue?
We probably need tests that operate on the backends directly, so we can determine if the problem is in our client implementation, or the executor, or the queryset?
from tortoise-orm.
Since we essentially removed the known broken pool implementation (and we still retain some of the benefit, such as persistent connection re-use) I'm closing this issue.
from tortoise-orm.
Related Issues (20)
- Connection closes if save method was triggered in pytest.
- Can't use check field name HOT 1
- Tortoise ORM tutorial missing context? HOT 4
- Tortoise orm F expression
- Docs request: if `pk` will be unique HOT 1
- Updating config at runtime
- Meta indexes are not created safely
- mssql named instance port number
- Add support for composite primary keys and foreign keys
- Corrupt sql generated when bulk_create method is configured with on_conflict parameter
- https://tortoise.github.io/0.19.1 gives 404
- model relationship bugged HOT 8
- why are there three files for one database? HOT 1
- auto_now not working HOT 2
- Field 'DatetimeField' has error when I use '__year' or '__month'. report this:" 'int' object has no attribute 'utcoffset' " HOT 1
- Tortoise ORM integration with FastAPI lifespan ('NoneType' object is not iterable) HOT 1
- update(balance=Wallet.balance+1) how to do this? HOT 1
- Req: concurrent use of multiple databases
- model.update_or_create KeyError HOT 3
- Bug: Pydantic 2.7 broke `pydantic_model_creator` HOT 7
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 tortoise-orm.