mirror of
https://github.com/ciur/papermerge.git
synced 2026-04-25 03:55:58 +03:00
[GH-ISSUE #575] Django ORM leaves DB connections open #449
Labels
No labels
2.1
3.0
3.0.1
3.0.2
3.0.3
3.0.3
3.1
3.2
3.2
3.3
3.5
3.x
Fixed. Waiting for feedback.
Fixed. Waiting for feedback.
UX
Version 2.1 - alpha
XSS
announcement
beta
blocker
bug
cannot reproduce
confirmed
confirmed
critical
demo
dependencies
deployment
detchnical debt
discussion
docker
documentation
donations
duplicate
enhancement
feature request
frontend
fundraising
good first issue
good issue
help wanted
high
implemented
important
improvement
incomplete
invalid
investigation
kubernetes
low
low impact
medium
medium
medium impact
migration from 2.0
migration from 2.1
missing-language
missing-ocr-language
no-activity
note
ocr
outofscope
packaging
performance
popular request
pull-request
pypi
question
raspberry pi
roadmap
search
security
setup
status
task
technical debt
updates
user xp
version 1.4.0 - demo
will be implemented
will not be implemented
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/papermerge#449
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ciur on GitHub (Jan 7, 2024).
Original GitHub issue: https://github.com/ciur/papermerge/issues/575
Originally assigned to: @ciur on GitHub.
Django ORM leaves open database connections in IDLE state for following REST API endpoints:
As result connections pile-up and when reaching specific limit, e.g. 100, 50, 25, depending on DB config, the app stops working as DB refuses all further connections. Same behavior was observed for PostgreSQL 16.1 and MariaDB 11.2.
Expected behavior: DB connections should be released when not used; or number of DB connections should remain stable when connection pooling is employed.
Info:
@ciur commented on GitHub (Jan 9, 2024):
First PR which fixes couple of critical endpoints: https://github.com/papermerge/papermerge-core/pull/292
@ciur commented on GitHub (Jan 10, 2024):
PR 2: https://github.com/papermerge/papermerge-core/pull/294
PR 3: https://github.com/papermerge/papermerge-core/pull/295
The solution is to replace Django ORM with SQLAlchemy. Of course ORM replacement it not matter of couple of weeks.
This ticket is for fixing the most critical parts so that app is usable in production.
This fix will be shipped in 3.0.1 release.