Milestone:+index page timing out

Bug #304113 reported by Ursula Junque
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Guilherme Salgado

Bug Description

As seen on OOPS-1064B1670, we're having several timeouts in +milestone/ubuntu-x.xx/+index pages, with high SQL and non-SQL times.

More oopses: OOPS-1064A1086, OOPS-1064A1241, OOPS-1064A1402, OOPS-1064A1879, OOPS-1064A283, OOPS-1064B1065, OOPS-1064B1385, OOPS-1064B1670, OOPS-1064B1813, OOPS-1064B245, OOPS-1064B1674, OOPS-1064B19, OOPS-1064B2553, OOPS-1064C1658, OOPS-1064F26, OOPS-1064G1826, OOPS-1064A1859, OOPS-1064B1789, OOPS-1064G1876, OOPS-1064H2404, OOPS-1064H2543, OOPS-1064A2438, OOPS-1064D1320

Revision history for this message
Curtis Hovey (sinzui) wrote :

Edwin. Can you look into the nature of this problem? Once you add a comment sumarising the problem and how we can fix it, mark it as triaged. We can decide who will do the work later.

Changed in launchpad-registry:
assignee: nobody → edwin-grubbs
Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Filtering on the bugtask.conjoined_master attribute in MilestoneView.bugtasks causes a separate query to be executed for each bug. This leads to 500-600 queries on the milestone +index page.

Changed in launchpad-registry:
importance: Undecided → High
status: New → Triaged
Revision history for this message
Guilherme Salgado (salgado) wrote :

The huge number of queries that Edwin mentioned are certainly something we need to fix, but I'd like to note the OOPS reports more than 15s of Non-sql time on that page, so just reducing the number of queries may not be enough.

Revision history for this message
Guilherme Salgado (salgado) wrote :

The queries are issued by bugtask.bug.bugtasks, which is called once for every bugtask returned by the search.

Kiko knew that was a problem and left an XXX there asking if there was a way to filter the results by their conjoined_master in the DB itself. It may be possible to do that, but given the logic I see in IBugTask.getConjoinedMaster(), I have the impression that will be at least pretty complicated.

Another option is to pre-fetch bugtask.bug and bugtask.bug.bugtasks for every bugtask in that page, but that'd require turning IBug.bugtasks into a cachedproperty and roll our own search method to also fetch all siblings of a bugtask and store that in the bugtask's bug. This seems like the only feasible solution to me.

Revision history for this message
Björn Tillenius (bjornt) wrote :

18:56 < BjornT> salgado: i don't think Bug.bugtasks should be made into a
                cachedproperty, but i think you're on the right track. it might
                make sense to create a new method, that builds a list of all
                the conjoined bugtasks (or non-conjoined ones)
18:57 < salgado> BjornT, why you don't think it should be made into a
                 cachedproperty?
18:57 < BjornT> salgado: because you have to ensure that the cache is
                invalidated when it should be; and that's not so trivial.
18:58 < BjornT> salgado: and, you want to avoid one query per bug
18
:59 < BjornT> salgado: using a cachedproperty will still issue one query, so
                things won't improve that much.
18:59 < salgado> BjornT, can you comment on the bug so that we have this
                 discussion stored there?
18:59 < salgado> BjornT, that by itself, yes. but my plan is to roll my own
                 search function which would pre-fill the cache
19:02 < BjornT> salgado: that sounds a bit complicated. given the issue with
                invalidating the cache, i'd say a separate method is more
                doable.

Revision history for this message
Guilherme Salgado (salgado) wrote :

mainline r7443

Changed in malone:
assignee: edwin-grubbs → salgado
status: Triaged → Fix Committed
milestone: none → 2.1.12
Changed in malone:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.