person collections in API late evaluate PersonTransferJob

Bug #739961 reported by Robert Collins
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Critical
Unassigned

Bug Description

No timeouts yet, but its just a matter of time.
----------------------------------------------------------------------
SELECT 1 FROM (SELECT PersonTransferJob.json_data, PersonTransferJob.id, PersonTransferJob.job, PersonTransferJob.job_type, PersonTransferJob.major_person, PersonTransferJob.minor_person FROM Job, PersonTransferJob WHERE
                  PersonTransferJob.job_type = 1 AND PersonTransferJob.job = Job.id AND Job.status IN (0, 1, 4) AND (PersonTransferJob.minor_person = 251673 OR PersonTransferJob.major_person = 251673) LIMIT 1) AS "_tmp" LIMIT 1
----------------------------------------------------------------------
SELECT 1 FROM (SELECT PersonTransferJob.json_data, PersonTransferJob.id, PersonTransferJob.job, PersonTransferJob.job_type, PersonTransferJob.major_person, PersonTransferJob.minor_person FROM Job, PersonTransferJob WHERE
                  PersonTransferJob.job_type = 1 AND PersonTransferJob.job = Job.id AND Job.status IN (0, 1, 4) AND (PersonTransferJob.minor_person = 251672 OR PersonTransferJob.major_person = 251672) LIMIT 1) AS "_tmp" LIMIT 1

To see the behaviour:
bin/harness
team = factory.makeTeam(members=[factory.makePerson() for _ in range(100)])
print team
transaction.commit()
 run 'make run LP_DEBUG_SQL=1' visit api.launchpad.dev/1.0/~TEAMNAME/participants ?ws.size=75

Related branches

tags: added: regression
Revision history for this message
Robert Collins (lifeless) wrote :

Also, I have to wonder why this is being looked up. having the job in the API seems uninteresting.

description: updated
Revision history for this message
Gavin Panella (allenap) wrote :

It's probably being queried to populate the Person.is_merge_pending property. The easiest fix would be to stop exporting this property via the web-service API, or changing it to a function. It's relatively new so we don't need to keep it around for the sake of the 1.0 API.

Curtis Hovey (sinzui)
tags: added: tech-debt
Curtis Hovey (sinzui)
Changed in launchpad:
assignee: nobody → Curtis Hovey (sinzui)
status: Triaged → In Progress
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
Changed in launchpad:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
tags: added: qa-ok
removed: qa-needstesting
Steve Kowalik (stevenk)
Changed in launchpad:
status: Fix Committed → Fix Released
Curtis Hovey (sinzui)
tags: added: disclosure teams
Curtis Hovey (sinzui)
Changed in launchpad:
assignee: Curtis Hovey (sinzui) → nobody
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.