Bug 462305 - I can't edit components in bugzilla
I can't edit components in bugzilla
Status: CLOSED NEXTRELEASE
Product: Bugzilla
Classification: Community
Component: Administration (Show other bugs)
3.2
All Linux
high Severity high (vote)
: ---
: ---
Assigned To: David Lawrence
:
Depends On:
Blocks: 474289
  Show dependency treegraph
 
Reported: 2008-09-15 05:14 EDT by Martin Stransky
Modified: 2013-06-24 00:05 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-13 23:38:17 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to speed up loading of editcomponents.cgi for larger comp lists (v1) (3.38 KB, patch)
2009-01-09 17:42 EST, David Lawrence
no flags Details | Diff
Patch to speed up loading of editcomponents.cgi for larger comp lists (v2) (3.42 KB, patch)
2009-01-11 17:57 EST, David Lawrence
no flags Details | Diff
Patch to speed up loading of editcomponents.cgi for larger comp lists (v3) (3.39 KB, patch)
2009-01-12 12:14 EST, David Lawrence
no flags Details | Diff
v4 patch to display loginnames correctly in editcomponents.cgi (4.38 KB, patch)
2009-01-13 04:33 EST, Noura El hawary
no flags Details | Diff
Patch to speed up loading of editcomponents.cgi for larger comp lists (v4) (4.54 KB, patch)
2009-01-13 16:54 EST, David Lawrence
nelhawar: review+
Details | Diff
Patch to speed up loading of editcomponents.cgi for larger comp lists (v5) (4.70 KB, patch)
2009-01-13 23:36 EST, David Lawrence
dkl: review+
Details | Diff

  None (edit)
Description Martin Stransky 2008-09-15 05:14:09 EDT
Description of problem:

I get when I want to edit components in bugzilla. (I get proxy error).


How reproducible:
Always

Steps to Reproduce:

Administration -> Product -> Fedora -> Edit components -> Proxy error
  
or https://bugzilla.redhat.com/editproducts.cgi?action=edit&product=Fedora&classification=Fedora
Comment 1 David Lawrence 2008-11-21 16:11:22 EST
Just tried to reverify that this is still occurring after the performance issues with Bugzilla had been fixed and this still occurs:

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /editcomponents.cgi.

Reason: Error reading from remote server

Basically due to the large number of components in Bugzilla for Fedora, and the way editcomponents.cgi loads them from the database, the proxy is timing out before the editcomponents.cgi page is finished loading. We will need to investigate how to speed up the load time of this page and others products with large component numbers as well.
Comment 2 David Lawrence 2009-01-09 17:42:54 EST
Created attachment 328599 [details]
Patch to speed up loading of editcomponents.cgi for larger comp lists (v1)

Hey Noura. Attaching a patch to speed up the loading of the editcomponents.cgi by hitting the database directly. The way the upstream has it using objects for everything is a large speed decrease with the amount of components we are using for some of our products. Also in admin/components/list.html.tmpl they are creating even more memory use by creating an override data structure for replacing userids with login_names which I am bypassing. It is a significant increase in speed without change in UI.

Let me know what you think.
Dave
Comment 3 David Lawrence 2009-01-11 17:57:26 EST
Created attachment 328683 [details]
Patch to speed up loading of editcomponents.cgi for larger comp lists (v2)

Needed to add a trick_taint($product_name) before the SQL call.

Dave
Comment 4 Noura El hawary 2009-01-12 08:34:35 EST
Comment on attachment 328683 [details]
Patch to speed up loading of editcomponents.cgi for larger comp lists (v2)

Hey Dave,

Patch looks good, only one thing, it is actually not working properly for components that has no qa_contact i believe this issue is coming from the query

>Index: editcomponents.cgi
>===================================================================

>+
>+    $query .= ", products, profiles devel, profiles qa " .
>+              "WHERE components.product_id = products.id AND products.name = ? " .
>+              "AND components.initialowner = devel.userid " .
>+              "AND components.initialqacontact = qa.userid ";
>+

Not all components have initialqacontact so the condition 
"AND components.initialqacontact = qa.userid " will not be met in that case. Also we need to handle this in the display so we display an empty box for undefined qa_contacts

Thanks,
Noura
Comment 5 David Lawrence 2009-01-12 12:14:40 EST
Created attachment 328765 [details]
Patch to speed up loading of editcomponents.cgi for larger comp lists (v3)

Thanks for the review Noura. I have updated editcomponents.cgi to account for null qa contacts and works better now.

Please review
Dave
Comment 6 Noura El hawary 2009-01-13 04:33:53 EST
Created attachment 328850 [details]
v4 patch to display loginnames correctly in editcomponents.cgi

Hey Dave,

I did another test for the patch, the previous issue with the null qa_contacts now is fixed, but i found another issue with the display of the login names of the default assignee and qa contact in the editcomponents.cgi, so basically if the page was loaded with no action then it displays fine but if it was loaded after add/delete/update action of a component then the loginnames will display Bugzilla::User hash, that is because default_assignee and default_qa_contact they actually return user object, so one solution i thought of was to add new accessor function to Bugzilla::Component that will return the login name of the qacontact and the assignee of the component and then i fixed your sql accordingly and fixed the name in the template as well this solution seems to work fine, attached is a patch, but i don't know maybe you have better solution. 

Thanks,
Noura
Comment 7 David Lawrence 2009-01-13 16:54:06 EST
Created attachment 328920 [details]
Patch to speed up loading of editcomponents.cgi for larger comp lists (v4)

Hey Noura. That won't work cause it still tries to load the entire product object with component objects when a component is changed and the components list is redisplayed. So that would be slow reloading as before the fix.

I mistakenly did not take into account reloading of the components list after an edit as I suspected that a redirect was occurring. When actually it is reloading the components/list.html.tmpl directly instead.

I put the SQL that loads the data into a separate function that is now called from each point in editcomponents.cgi that reloads the component list.

Please let me know what you think.
Dave
Comment 8 Noura El hawary 2009-01-13 20:11:32 EST
Comment on attachment 328920 [details]
Patch to speed up loading of editcomponents.cgi for larger comp lists (v4)

Hey Dave,

Patch looks good I tested it and it works fine, but to be able to test it i had to make the variables:

$product_name and $showbugcounts global by replacing 'my' with 'our' in their declaration.

Thanks,
Noura
Comment 9 David Lawrence 2009-01-13 23:36:34 EST
Created attachment 328943 [details]
Patch to speed up loading of editcomponents.cgi for larger comp lists (v5)

Thanks Noura. I need to start doing the httpd restart thing in the future for my testing as I did not see the error. The error is mod_perl related. I have changed the load_product_data() function to take the $product_name and $showbugcounts variables as arguments which will solve the warning.

Rolling over review from previous patch and committing to CVS.

Thanks
Dave

Note You need to log in before you can comment on or make changes to this bug.