Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 313830 Details for
Bug 458223
mod_perl & buglist queries OOM apache
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch to limit amount of rows returned to the user in buglist.cgi and webservices (v1)
buglist_row_limit.patch (text/plain), 8.37 KB, created by
David Lawrence
on 2008-08-08 18:36:01 UTC
(
hide
)
Description:
Patch to limit amount of rows returned to the user in buglist.cgi and webservices (v1)
Filename:
MIME Type:
Creator:
David Lawrence
Created:
2008-08-08 18:36:01 UTC
Size:
8.37 KB
patch
obsolete
>? .buglist.cgi.swp >? bugzilla-3.2rh-20080808.1.tar.gz >? bugzilla.spec >? localconfig >? patches >? data/params >? skins/contrib/RedHat/index.css.back >? template/en/default/index.html.tmpl.back >Index: buglist.cgi >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/buglist.cgi,v >retrieving revision 1.19 >diff -u -r1.19 buglist.cgi >--- buglist.cgi 8 Aug 2008 04:59:47 -0000 1.19 >+++ buglist.cgi 8 Aug 2008 18:33:05 -0000 >@@ -1044,11 +1044,30 @@ > push(@bugidlist, $bug->{'bug_id'}); > } > >+# REDHAT EXTENSION BEGIN 406301 >+# Log the number of rows returned. We have to do it here >+# because DBI doesn't now how many rows are affected with >+# a SELECT until they have all been fetched. >+my $rows_returned = $buglist_sth->rows; >+$logger->debug("rows returned: $rows_returned"); >+# REDHAT EXTENSION BEGIN 406301 >+ >+# REDHAT EXTENSION BEGIN 458223 >+# Queries that return too many bugs cause large amounts of >+# ram to be used by mod_perl. We will cap the number at >+# Bugzilla->params->{buglistrowlimit} and increase over time >+# as we optimize the server config. >+my $too_many_bugs = 0; >+if ($rows_returned > Bugzilla->params->{buglistrowlimit}) { >+ $too_many_bugs = 1; >+} >+# REDHAT EXTENSION END 458223 >+ > # Check for bug privacy and set $bug->{'secure_mode'} to 'implied' or 'manual' > # based on whether the privacy is simply product implied (by mandatory groups) > # or because of human choice > my %min_membercontrol; >-if (@bugidlist) { >+if (@bugidlist && !$too_many_bugs) { > my $sth = $dbh->prepare( > "SELECT DISTINCT bugs.bug_id, MIN(group_control_map.membercontrol) " . > "FROM bugs " . >@@ -1240,6 +1259,13 @@ > > _close_standby_message($contenttype, $disposition, $serverpush); > >+# REDHAT EXTENSION BEGIN 458223 >+if ($too_many_bugs) { >+ ThrowUserError('too_many_bugs', { rows_returned => $rows_returned, >+ buglist_total => Bugzilla->params->{buglistrowlimit} }); >+} >+# REDHAT EXTENSION END 458223 >+ > ################################################################################ > # Content Generation > ################################################################################ >Index: Bugzilla/Config/Admin.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/Config/Admin.pm,v >retrieving revision 1.2 >diff -u -r1.2 Admin.pm >--- Bugzilla/Config/Admin.pm 2 Apr 2008 00:42:06 -0000 1.2 >+++ Bugzilla/Config/Admin.pm 8 Aug 2008 18:33:05 -0000 >@@ -71,8 +71,16 @@ > name => 'log4perl_config', > type => 'l', > default => Bugzilla::Constants::LOG4PERL_DEFAULT_CONFIG, >- } >+ }, > # REDHAT EXTENSION END 406301 >+ >+ # REDHAT EXTENSION START 458223 >+ { >+ name => 'buglistrowlimit', >+ type => 't', >+ default => '20000', >+ }, >+ # REDHAT EXTENSION END 458223 > ); > return @param_list; > } >Index: Bugzilla/WebService/Bug.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/WebService/Bug.pm,v >retrieving revision 1.17 >diff -u -r1.17 Bug.pm >--- Bugzilla/WebService/Bug.pm 24 Jul 2008 21:28:41 -0000 1.17 >+++ Bugzilla/WebService/Bug.pm 8 Aug 2008 18:33:05 -0000 >@@ -608,6 +608,25 @@ > push(@bugidlist, $bug->{'bug_id'}); > } > >+ # REDHAT EXTENSION BEGIN 406301 >+ # Log the number of rows returned. We have to do it here >+ # because DBI doesn't now how many rows are affected with >+ # a SELECT until they have all been fetched. >+ my $rows_returned = $buglist_sth->rows; >+ $logger->debug("rows returned: $rows_returned"); >+ # REDHAT EXTENSION BEGIN 406301 >+ >+ # REDHAT EXTENSION BEGIN 458223 >+ # Queries that return too many bugs cause large amounts of >+ # ram to be used by mod_perl. We will cap the number at >+ # Bugzilla->params->{buglistrowlimit} and increase over time >+ # as we optimize the server config. >+ if ($rows_returned > Bugzilla->params->{buglistrowlimit}) { >+ ThrowUserError('too_many_bugs', { rows_returned => $rows_returned, >+ buglist_total => Bugzilla->params->{buglistrowlimit} }); >+ } >+ # REDHAT EXTENSION END 458223 >+ > my %min_membercontrol; > if (@bugidlist) { > my $sth = $dbh->prepare( >Index: Bugzilla/WebService/Constants.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/WebService/Constants.pm,v >retrieving revision 1.13 >diff -u -r1.13 Constants.pm >--- Bugzilla/WebService/Constants.pm 20 Jun 2008 19:31:40 -0000 1.13 >+++ Bugzilla/WebService/Constants.pm 8 Aug 2008 18:33:05 -0000 >@@ -111,7 +111,7 @@ > buglist_parameters_required => 507, > saved_search_login_required => 508, > missing_query => 509, >- >+ too_many_bugs => 510, > }; > > # These are the fallback defaults for errors not in ERROR_CODE. >Index: extensions/compat_xmlrpc/code/webservice.pl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/extensions/compat_xmlrpc/code/webservice.pl,v >retrieving revision 1.47 >diff -u -r1.47 webservice.pl >--- extensions/compat_xmlrpc/code/webservice.pl 4 Aug 2008 16:16:19 -0000 1.47 >+++ extensions/compat_xmlrpc/code/webservice.pl 8 Aug 2008 18:33:05 -0000 >@@ -1233,6 +1233,25 @@ > push(@bugidlist, $bug->{'bug_id'}); > } > >+ # REDHAT EXTENSION BEGIN 406301 >+ # Log the number of rows returned. We have to do it here >+ # because DBI doesn't now how many rows are affected with >+ # a SELECT until they have all been fetched. >+ my $rows_returned = $buglist_sth->rows; >+ $logger->debug("rows returned: $rows_returned"); >+ # REDHAT EXTENSION BEGIN 406301 >+ >+ # REDHAT EXTENSION BEGIN 458223 >+ # Queries that return too many bugs cause large amounts of >+ # ram to be used by mod_perl. We will cap the number at >+ # Bugzilla->params->{buglistrowlimit} and increase over time >+ # as we optimize the server config. >+ if ($rows_returned > Bugzilla->params->{buglistrowlimit}) { >+ ThrowUserError('too_many_bugs', { rows_returned => $rows_returned, >+ buglist_total => Bugzilla->params->{buglistrowlimit} }); >+ } >+ # REDHAT EXTENSION END 458223 >+ > my %min_membercontrol; > if (@bugidlist) { > my $sth = $dbh->prepare( >Index: template/en/default/admin/params/admin.html.tmpl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/template/en/default/admin/params/admin.html.tmpl,v >retrieving revision 1.2 >diff -u -r1.2 admin.html.tmpl >--- template/en/default/admin/params/admin.html.tmpl 2 Apr 2008 00:43:28 -0000 1.2 >+++ template/en/default/admin/params/admin.html.tmpl 8 Aug 2008 18:33:06 -0000 >@@ -47,5 +47,8 @@ > "vacation, and QA folks watching particular developers' ${terms.bugs}.", > > log4perl_config => "Enable logging of Web UI and XMLRPC requests by entering the log4perl " _ >- "conf file in the text box."} >+ "conf file in the text box.", >+ >+ buglistrowlimit => "Total number of rows buglist.cgi is allowed to return from the database without " _ >+ "generating an error."} > %] >Index: template/en/default/global/user-error.html.tmpl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/template/en/default/global/user-error.html.tmpl,v >retrieving revision 1.32 >diff -u -r1.32 user-error.html.tmpl >--- template/en/default/global/user-error.html.tmpl 8 Aug 2008 05:13:32 -0000 1.32 >+++ template/en/default/global/user-error.html.tmpl 8 Aug 2008 18:33:06 -0000 >@@ -1653,6 +1653,17 @@ > [% title = "Multiple Components Update Not allowed" %] > You can not update the name for multiple components of the > same product. >+ >+ [%# REDHAT EXTENSION START 458223 %] >+ [% ELSIF error == "too_many_bugs" %] >+ [% title = "Too Many $terms.Bugs Returned" %] >+ Your query returned [% rows_returned FILTER html %] [%+ terms.bugs %] and >+ [%+ terms.Bugzilla %] will only return [% buglist_total FILTER html %] or less [% terms.bugs %]. >+ Please back up and narrow your search criteria. If you feel your results >+ were expected and your search criteria was correct, please send email to >+ <a href="mailto:[% Param("maintainer") %]">[% Param("maintainer") %]</a> >+ describing what you were doing and we will correct the error. >+ [%# REDHAT EXTENSION END 458223 %] > > [% ELSE %] >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 458223
:
313830
|
313833
|
313846