Database is hit during module load
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Software Center Agent |
Fix Released
|
Medium
|
Natalia Bidart |
Bug Description
Steps to reproduce:
1) Edit your database settings so that there's no valid db (ie. change password)
2) curl a url which is a simple redirect (ie. does not need database) http://
Expected result:
3a) Normal redirect to /dev/
Actual result:
3b) app tries to access database at module load time.
Normally this wouldn't be a huge issue, but when the database latency is huge, it quickly becomes one.
Recently, the src/clickpackag
If we could instead return a (lazy) query set with the required store, so it only hits the db when used, that would be great.
There's also another point which hits the database unnecessarily, but it's been there for a few months: DepartmentField
With both of these fixed, there are zero database queries for simple redirects or other pages which don't use the database (ie. database is not hit during module load).
It would be great to add a test which ensures we don't add any other database hits during module load.
description: | updated |
Changed in software-center-agent: | |
status: | New → In Progress |
assignee: | nobody → Natalia Bidart (nataliabidart) |
importance: | Undecided → Medium |
Changed in software-center-agent: | |
status: | In Progress → Fix Committed |
Changed in software-center-agent: | |
status: | Fix Committed → Fix Released |