Error 503 when trying to iterate over lp.people[team].participants

Bug #1921727 reported by Marcus Tomlinson
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Critical
Colin Watson

Bug Description

This minimal program: https://paste.ubuntu.com/p/kCxNCvHxhy/
results in the following exception: https://paste.ubuntu.com/p/vZNBP5PySf/

This logic is used in the ubuntu-desktop-installer cla-check workflow:
  - 3 days ago: https://github.com/canonical/ubuntu-desktop-installer/runs/2204399908?check_suite_focus=true#step:2:77
  - Today: https://github.com/canonical/ubuntu-desktop-installer/runs/2216796618?check_suite_focus=true#step:2:78

It appears something has broken in LP between last week and today.

Related branches

description: updated
Revision history for this message
Paweł Stołowski (stolowski) wrote :

I'm seeing this a lot as well (on snapd project).

Revision history for this message
Colin Watson (cjwatson) wrote :

Quoting the OOPS ID inline here so that oops-tools knows not to garbage-collect it: OOPS-1f3bc04ee184e988ae1d2f8ba056352a

Revision history for this message
Colin Watson (cjwatson) wrote :
Download full text (17.3 KiB)

I think this query tipped over the edge of a performance cliff. Query plan on staging:

                                                                                                         QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Limit (cost=744282.38..744599.49 rows=76 width=3123) (actual time=125.687..125.848 rows=76 loops=1)
   Buffers: shared hit=37477
   -> Result (cost=743343.57..746552.22 rows=769 width=3123) (actual time=125.231..125.818 rows=301 loops=1)
         Buffers: shared hit=37477
         -> Sort (cost=743343.57..743345.49 rows=769 width=3122) (actual time=102.384..102.426 rows=301 loops=1)
               Sort Key: (person_sort_key(person.displayname, person.name))
               Sort Method: top-N heapsort Memory: 534kB
               Buffers: shared hit=36818
               -> Nested Loop Left Join (cost=693.97..743308.07 rows=769 width=3122) (actual time=0.324..97.048 rows=1025 loops=1)
                     Buffers: shared hit=36818
                     -> Nested Loop Left Join (cost=693.40..740651.59 rows=769 width=2983) (actual time=0.231..65.660 rows=1025 loops=1)
                           Buffers: shared hit=35537
                           -> Nested Loop Left Join (cost=692.83..738187.36 rows=769 width=2876) (actual time=0.218..62.725 rows=1025 loops=1)
                                 Buffers: shared hit=34650
                                 -> Nested Loop Left Join (cost=692.39..735921.14 rows=769 width=2771) (actual time=0.204..55.545 rows=1025 loops=1)
                                       Buffers: shared hit=30558
                                       -> Nested Loop Left Join (cost=691.96..733660.46 rows=769 width=2730) (actual time=0.190..48.301 rows=1025 loops=1)
                                             Buffers: shared hit=26459
                                             -> Nested Loop Left Join (cost=1.57..8142.33 rows=769 width=1073) (actual time=0.065..21.633 rows=1025 loops=1)
                                                   Buffers: shared hit=10896
                                                   -> Nested Loop Left Join (cost=1.15..5891.74 rows=769 width=1012) (actual time=0.054..16.892 rows=1025 loops=1)
                                                         Buffers: shared hit=7413
                                                         -> Nested Loop (cost=0.86..3765.18 rows=769 width=1000) (actual time=0.045..13.046 rows=1025 loops=1)
                                                               Buffers: shared hit=5132
                                                               -> Index Only Scan using teamparticipation_team_key on teamparticipation (cost=0.43..681.33 rows=769 width=4) (actual time=0.034..3.791 rows=1025 loops=1)
                                                                     Index Cond: (team = 2962068)
                                                                     Filter: (person <> 2962068)
                                        ...

Changed in launchpad:
status: New → In Progress
importance: Undecided → Critical
assignee: nobody → Colin Watson (cjwatson)
tags: added: lp-registry oops timeout
Colin Watson (cjwatson)
Changed in launchpad:
status: In Progress → Fix Committed
Colin Watson (cjwatson)
Changed in launchpad:
status: Fix Committed → Fix Released
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

Excellent, thanks for that! I can confirm this is now working.

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.