BranchSet:CollectionResource#branches timeouts

Bug #722956 reported by Robert Collins
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Critical
Robert Collins

Bug Description

 205 SELECT Person.account, Person.creation_comment, Person.creation_rationale, Person.datecreated, Pe ... Person.verbose_bugnotifications, Person.visibility FROM Person WHERE Person.id = $INT LIMIT $INT:
   GET: 203 Other: 2 Robots: 115 Local: 18
     17 https://api.launchpad.net/1.0/branches (BranchSet:CollectionResource:#branches)
       OOPS-1878O1181, OOPS-1878O1431, OOPS-1878O1654, OOPS-1878O2010, OOPS-1878O2026

Branch: launchpad-rev-12406
Revno: 12406
SQL time: 11955 ms
Non-sql time: 2488 ms
Total time: 14443 ms
Statement Count: 267

One long query which is tolerable:
1 1395.0 1 SQL-launchpad-main-master
SELECT Branch.branch_format,
       Branch.branch_type,
       Branch.metadir_format,
       Branch.date_created,
       Branch.date_last_modified,
       Branch.summary,
       Branch.distroseries,
       Branch.id,
       Branch.last_mirror_attempt,
       Branch.last_mirrored,
       Branch.last_mirrored_id,
       Branch.last_scanned,
       Branch.last_scanned_id,
       Branch.lifecycle_status,
       Branch.merge_queue_config,
       Branch.merge_queue,
       Branch.mirror_failures,
       Branch.mirror_status_message,
       Branch.name,
       Branch.next_mirror_time,
       Branch.OWNER, Branch.owner_name,
                     Branch.private,
                     Branch.product,
                     Branch.registrant,
                     Branch.repository_format,
                     Branch.reviewer,
                     Branch.revision_count,
                     Branch.sourcepackagename,
                     Branch.stacked_on,
                     Branch.target_suffix,
                     Branch.unique_name,
                     Branch.url,
                     Branch.whiteboard
FROM Branch
WHERE Branch.private = FALSE
  AND Branch.last_scanned IS NOT NULL
  AND Branch.private = FALSE
ORDER BY Branch.date_last_modified DESC, Branch.id DESC LIMIT $INT
OFFSET $INT

many seconds in repeated querys:

Repeated SQL Statements top

Reps Total time Average time Saving Database id Statement
1 62 1657 26 1631 SQL-launchpad-main-master
SELECT SeriesSourcePackageBranch.branch,
       SeriesSourcePackageBranch.date_created,
       SeriesSourcePackageBranch.distroseries,
       SeriesSourcePackageBranch.id,
       SeriesSourcePackageBranch.pocket,
       SeriesSourcePackageBranch.registrant,
       SeriesSourcePackageBranch.sourcepackagename
FROM SeriesSourcePackageBranch
WHERE SeriesSourcePackageBranch.branch = $INT
ORDER BY SeriesSourcePackageBranch.pocket
2 62 1541 24 1517 SQL-launchpad-main-master
SELECT ProductSeries.branch,
       ProductSeries.datecreated,
       ProductSeries.driver,
       ProductSeries.id,
       ProductSeries.name,
       ProductSeries.OWNER, ProductSeries.product,
                            ProductSeries.releasefileglob,
                            ProductSeries.releaseverstyle,
                            ProductSeries.status,
                            ProductSeries.summary,
                            ProductSeries.translations_autoimport_mode,
                            ProductSeries.translations_branch
FROM ProductSeries
WHERE ProductSeries.branch = $INT
3 53 2765 52 2713 SQL-launchpad-main-master
SELECT Person.account,
       Person.creation_comment,
       Person.creation_rationale,
       Person.datecreated,
       Person.defaultmembershipperiod,
       Person.defaultrenewalperiod,
       Person.displayname,
       Person.hide_email_addresses,
       Person.homepage_content,
       Person.icon,
       Person.id,
       Person.logo,
       Person.mailing_list_auto_subscribe_policy,
       Person.merged,
       Person.mugshot,
       Person.name,
       Person.personal_standing,
       Person.personal_standing_reason,
       Person.registrant,
       Person.renewal_policy,
       Person.subscriptionpolicy,
       Person.teamdescription,
       Person.teamowner,
       Person.verbose_bugnotifications,
       Person.visibility
FROM Person
WHERE Person.id = $INTLIMIT $INT
4 34 1568 46 1522 SQL-launchpad-main-master
SELECT CodeImport.assignee,
       CodeImport.branch,
       CodeImport.cvs_module,
       CodeImport.cvs_root,
       CodeImport.date_created,
       CodeImport.date_last_successful,
       CodeImport.id,
       CodeImport.OWNER, CodeImport.rcs_type,
                         CodeImport.registrant,
                         CodeImport.review_status,
                         CodeImport.update_interval,
                         CodeImport.url
FROM CodeImport
WHERE CodeImport.branch = $INT
ORDER BY CodeImport.id
5 28 2196 78 2118 SQL-launchpad-main-master
SELECT Product.answers_usage,
       Product.blueprints_usage,
       Product.OWNER, Product.translations_usage,
                      Product.active,
                      Product.autoupdate,
                      Product.bug_reported_acknowledgement,
                      Product.bug_reporting_guidelines,
                      Product.bug_supervisor,
                      Product.bugtracker,
                      Product.date_next_suggest_packaging,
                      Product.datecreated,
                      Product.description,
                      Product.development_focus,
                      Product.displayname,
                      Product.downloadurl,
                      Product.driver,
                      Product.enable_bug_expiration,
                      Product.enable_bugfiling_duplicate_search,
                      Product.freshmeatproject,
                      Product.homepage_content,
                      Product.homepageurl,
                      Product.icon,
                      Product.id,
                      Product.lastdoap,
                      Product.license_approved,
                      Product.license_info,
                      Product.reviewed,
                      Product.logo,
                      Product.max_bug_heat,
                      Product.mugshot,
                      Product.name,
                      Product.official_answers,
                      Product.official_blueprints,
                      Product.official_malone,
                      Product.official_rosetta,
                      Product.private_bugs,
                      Product.programminglang,
                      Product.project,
                      Product.registrant,
                      Product.remote_product,
                      Product.reviewer_whiteboard,
                      Product.screenshotsurl,
                      Product.security_contact,
                      Product.sourceforgeproject,
                      Product.summary,
                      Product.title,
                      Product.translation_focus,
                      Product.translationgroup,
                      Product.translationpermission,
                      Product.wikiurl
FROM Product
WHERE Product.id = $INTLIMIT $INT

lazy evaluation of:
 products
 codeimports
 productseries
 sourcepackages
 persons

Related branches

description: updated
Revision history for this message
Robert Collins (lifeless) wrote :

One cause looks like late evaluation of sourcepackage.linked_branches

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

An example entry:
{"control_format": "Bazaar-NG meta directory, format 1\n", "unique_name": "~dhis2-devs-core/dhis2/trunk", "date_last_modified": "2011-02-27T22:35:43.381000+00:00", "sourcepackage_link": null, "merge_queue_link": null, "private": false, "registrant_link": "https://api.launchpad.net/1.0/~larshelge", "linked_bugs_collection_link": "https://api.launchpad.net/1.0/~dhis2-devs-core/dhis2/trunk/linked_bugs", "branch_format": "Bazaar Branch Format 6 (bzr 0.15)\n", "last_mirrored": "2011-02-27T22:35:46.105065+00:00", "subscriptions_collection_link": "https://api.launchpad.net/1.0/~dhis2-devs-core/dhis2/trunk/subscriptions", "lifecycle_status": "Development", "last_scanned_id": "<email address hidden>", "dependent_branches_collection_link": "https://api.launchpad.net/1.0/~dhis2-devs-core/dhis2/trunk/dependent_branches", "http_etag": "\"7a8370616a302ccd2aa4f12fae6dd83bcc49d94f-839b513ad293dc37d334a902d826be8c96867af7\"", "spec_links_collection_link": "https://api.launchpad.net/1.0/~dhis2-devs-core/dhis2/trunk/spec_links", "name": "trunk", "reviewer_link": null, "self_link": "https://api.launchpad.net/1.0/~dhis2-devs-core/dhis2/trunk", "resource_type_link": "https://api.launchpad.net/1.0/#branch", "revision_count": 2926, "repository_format": "Bazaar pack repository format 1 (needs bzr 0.92)\n", "description": "The trunk is where the mainline development takes place.", "landing_targets_collection_link": "https://api.launchpad.net/1.0/~dhis2-devs-core/dhis2/trunk/landing_targets", "mirror_status_message": null, "subscribers_collection_link": "https://api.launchpad.net/1.0/~dhis2-devs-core/dhis2/trunk/subscribers", "recipes_collection_link": "https://api.launchpad.net/1.0/~dhis2-devs-core/dhis2/trunk/recipes", "project_link": "https://api.launchpad.net/1.0/dhis2", "landing_candidates_collection_link": "https://api.launchpad.net/1.0/~dhis2-devs-core/dhis2/trunk/landing_candidates", "display_name": "lp:dhis2", "branch_type": "Hosted", "bzr_identity": "lp:dhis2", "merge_queue_config": null, "last_scanned": "2011-02-27T22:36:45.987946+00:00", "url": null, "whiteboard": null, "code_import_link": null, "web_link": "https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk", "owner_link": "https://api.launchpad.net/1.0/~dhis2-devs-core", "last_mirror_attempt": "2010-05-04T06:50:05.390333+00:00", "date_created": "2009-03-03T16:50:16.367591+00:00"}

description: updated
Revision history for this message
Robert Collins (lifeless) wrote :
Download full text (9.7 KiB)

some of the culprits.

  File "/home/robertc/launchpad/lp-branches/working/lib/lp/code/interfaces/branch.py", line 1356, in bzr_identity
    identity, context = self.branchIdentities()[0]
  File "/home/robertc/launchpad/lp-branches/working/lib/lp/code/interfaces/branch.py", line 1367, in branchIdentities
    for link in self.branchLinks()]
  File "/home/robertc/launchpad/lp-branches/working/lib/lp/code/interfaces/branch.py", line 1374, in branchLinks
    for suite_sp in self.associatedSuiteSourcePackages():
  File "/home/robertc/launchpad/lp-branches/working/lib/lp/code/model/branch.py", line 729, in associatedSuiteSourcePackages
    return [link.suite_sourcepackage for link in links]
  File "/home/robertc/launchpad/lp-sourcedeps/eggs/storm-0.18-py2.6-linux-x86_64.egg/storm/store.py", line 982, in __iter__
    result = self._store._connection.execute(self._get_select())
  File "/home/robertc/launchpad/lp-sourcedeps/eggs/storm-0.18-py2.6-linux-x86_64.egg/storm/databases/postgres.py", line 249, in execute
    return Connection.execute(self, statement, params, noresult)
  File "/home/robertc/launchpad/lp-sourcedeps/eggs/storm-0.18-py2.6-linux-x86_64.egg/storm/database.py", line 237, in execute
    raw_cursor = self.raw_execute(statement, params)
  File "/home/robertc/launchpad/lp-sourcedeps/eggs/storm-0.18-py2.6-linux-x86_64.egg/storm/databases/postgres.py", line 259, in raw_execute
    return Connection.raw_execute(self, statement, params)
  File "/home/robertc/launchpad/lp-sourcedeps/eggs/storm-0.18-py2.6-linux-x86_64.egg/storm/database.py", line 315, in raw_execute
    statement, params or ())
  File "/home/robertc/launchpad/lp-sourcedeps/eggs/storm-0.18-py2.6-linux-x86_64.egg/storm/database.py", line 366, in _check_disconnect
    return function(*args, **kwargs)
  File "/home/robertc/launchpad/lp-sourcedeps/eggs/storm-0.18-py2.6-linux-x86_64.egg/storm/tracer.py", line 113, in trace
    attr(*args, **kwargs)
  File "/home/robertc/launchpad/lp-branches/working/lib/canonical/launchpad/webapp/adapter.py", line 607, in connection_raw_execute
    traceback.print_stack()
......................................................................
SELECT SeriesSourcePackageBranch.branch, SeriesSourcePackageBranch.date_created, SeriesSourcePackageBranch.distroseries, SeriesSourcePackageBranch.id, SeriesSourcePackageBranch.pocket, SeriesSourcePackageBranch.registrant, SeriesSourcePack
ageBranch.sourcepackagename FROM SeriesSourcePackageBranch WHERE SeriesSourcePackageBranch.branch = 78 ORDER BY SeriesSourcePackageBranch.pocket

  File "/home/robertc/launchpad/lp-branches/working/lib/lp/code/interfaces/branch.py", line 1356, in bzr_identity
    identity, context = self.branchIdentities()[0]
  File "/home/robertc/launchpad/lp-branches/working/lib/lp/code/interfaces/branch.py", line 1367, in branchIdentities
    for link in self.branchLinks()]
  File "/home/robertc/launchpad/lp-branches/working/lib/lp/code/interfaces/branch.py", line 1380, in branchLinks
    for series in self.associatedProductSeries():
  File "/home/robertc/launchpad/lp-sourcedeps/eggs/storm-0.18-py2.6-linux-x86_64.egg/storm/store.py", line 982, in __iter__
    result = self._store._connectio...

Read more...

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

I've addressed ProductSeries and SourcePackageSeries in the branch I"m pushing now; that should save some seconds.

Changed in launchpad:
assignee: nobody → Robert Collins (lifeless)
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
Changed in launchpad:
milestone: none → 11.03
tags: added: qa-needstesting
Changed in launchpad:
status: Triaged → Fix Committed
Revision history for this message
Robert Collins (lifeless) wrote :

I'm on it.

tags: added: bad-commit-12489
Revision history for this message
Robert Collins (lifeless) wrote :

Fix is in PQM; was a one liner - an attribute previously existing on the class which wasn't in the interface.

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

stll bad, wgrant rolling back. Will fix tomorrow.

William Grant (wgrant)
tags: added: bad-commit-12505
tags: added: qa-bad
removed: qa-needstesting
William Grant (wgrant)
Changed in launchpad:
status: Fix Committed → Fix Released
status: Fix Released → In Progress
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
removed: qa-bad
Changed in launchpad:
status: In Progress → Fix Committed
tags: added: qa-ok
removed: qa-needstesting
Changed in launchpad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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