]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1347335 - Lifecycle of request cache begin at apache startup
authorDylan William Hardison <dylan@hardison.net>
Fri, 17 Mar 2017 16:59:11 +0000 (12:59 -0400)
committerDylan William Hardison <dylan@hardison.net>
Fri, 17 Mar 2017 20:52:47 +0000 (16:52 -0400)
Bugzilla.pm
mod_perl.pl

index 55e4169330697d91d94a0728724f6ee1fa5b289c..bd410364eb08b457cc3c47d24b83980c823df72d 100644 (file)
@@ -79,6 +79,10 @@ use constant SHUTDOWNHTML_RETRY_AFTER => 3600;
 
 # Note that this is a raw subroutine, not a method, so $class isn't available.
 sub init_page {
+    # This is probably not needed, but bugs resulting from a dirty
+    # request cache are very annoying (see bug 1347335)
+    # and this is not an expensive operation.
+    clear_request_cache();
     if (Bugzilla->usage_mode == USAGE_MODE_CMDLINE) {
         init_console();
     }
index 29d9005c353b5d5f44834201d8bd64ee8329b75e..bbca30c2e3074ae307cb8ca6bfd9749e5fd80c02 100644 (file)
@@ -80,7 +80,7 @@ PerlChildInitHandler "sub { Bugzilla::RNG::srand(); srand(); }"
     AddHandler perl-script .cgi
     # No need to PerlModule these because they're already defined in mod_perl.pl
     PerlResponseHandler Bugzilla::ModPerl::ResponseHandler
-    PerlCleanupHandler  Apache2::SizeLimit Bugzilla::ModPerl::CleanupHandler
+    PerlCleanupHandler Bugzilla::ModPerl::CleanupHandler Apache2::SizeLimit
     PerlOptions +ParseHeaders
     Options +ExecCGI +FollowSymLinks
     AllowOverride Limit FileInfo Indexes
@@ -116,6 +116,11 @@ foreach my $file (glob "$cgi_path/*.cgi") {
     $rl->handler($file, $file);
 }
 
+# Some items might already be loaded into the request cache
+# best to make sure it starts out empty.
+# Because of bug 1347335 we also do this in init_page().
+Bugzilla::clear_request_cache();
+
 package Bugzilla::ModPerl::ResponseHandler;
 use strict;
 use base qw(ModPerl::Registry);
@@ -160,11 +165,6 @@ sub handler {
     my $r = shift;
 
     Bugzilla::_cleanup();
-    # Sometimes mod_perl doesn't properly call DESTROY on all
-    # the objects in pnotes()
-    foreach my $key (keys %{$r->pnotes}) {
-        delete $r->pnotes->{$key};
-    }
 
     return Apache2::Const::OK;
 }