]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1445700 - apache_size_limit should be 800_000 when Linux::Smaps is not installed.
authorDylan William Hardison <dylan@hardison.net>
Wed, 14 Mar 2018 22:24:49 +0000 (18:24 -0400)
committerGitHub <noreply@github.com>
Wed, 14 Mar 2018 22:24:49 +0000 (18:24 -0400)
.circleci/config.yml
Dockerfile
Makefile.PL
mod_perl.pl

index 7d9cfdfde6e7a1ba206fc1d8b3d3cd9e6d1be9d5..48899d25440b5e4a001ae26349ab62f4e6be7da4 100644 (file)
@@ -16,7 +16,7 @@ main_filters: &main_filters
 
 defaults:
   bmo_slim_image: &bmo_slim_image
-    image: mozillabteam/bmo-slim:20180313.1
+    image: mozillabteam/bmo-slim:20180314.1
     user: app
 
   mysql_image: &mysql_image
index d367a80d41191087c2464f4edcea0a12f7315e41..056c8185ac0a126fd7bff1b2f3139dbba5bad5f4 100644 (file)
@@ -1,4 +1,4 @@
-FROM mozillabteam/bmo-slim:20180313.1
+FROM mozillabteam/bmo-slim:20180314.1
 
 ARG CI
 ARG CIRCLE_SHA1
index d7c359bf0be9ae22cf2ab15212eb0bc29d93f974..ceb0fc97c9e9aa36d1c0067ec7d2dbb0a8ff9d00 100755 (executable)
@@ -95,19 +95,13 @@ if ( $OSNAME eq 'MSWin32' ) {
     $requires{'DateTime::TimeZone::Local::Win32'} = '1.64';
 }
 
-if ( $OSNAME eq 'linux' ) {
-    # This isn't strictly needed, but it is nice to have.
-    # we use it to make sure jobqueue-workers exit when their parent exits.
-    my @extra = qw(Linux::Pdeathsig);
-
-    # for some reason, we need these on ubuntu.
-    push @extra, qw(
-        Linux::Pid
+if ( $OSNAME eq 'linux' && -f '/etc/debian_version' ) {
+    my @extra = qw(
         Test::Pod::Coverage
         Pod::Coverage::TrustPod
         Test::CPAN::Meta
         Test::Pod
-    ) if -f '/etc/debian_version';
+    );
     $requires{$_} = 0 for @extra;
 }
 
@@ -315,6 +309,22 @@ my %optional_features = (
             },
         },
     },
+    linux_smaps => {
+        description => 'Linux::Smaps for limiting memory usage',
+        prereqs => {
+            runtime => {
+                requires => { 'Linux::Smaps' => '0' },
+            }
+        },
+    },
+    linux_pdeath => {
+        description => 'Linux::Pdeathsig for a good parent/child relationships',
+        prereqs => {
+            runtime => {
+                requires => { 'Linux::Pdeathsig' => 0 },
+            },
+        },
+    },
     jobqueue => {
         description => 'Mail Queueing',
         prereqs     => {
@@ -362,21 +372,7 @@ for my $file ( glob 'extensions/*/Config.pm' ) {
 }
 
 # BMO Customization
-my @bmo_features = grep {
-    !m{
-        ^
-        (?: pg
-          | oracle
-          | mod_perl
-          | sqlite
-          | auth_ldap
-          | auth_radius
-          | smtp_auth
-          | linux_pid
-          | updates)
-        $
-    }mxs;
-} keys %optional_features;
+my @bmo_features = grep { is_bmo_feature($_) } keys %optional_features;
 
 $optional_features{bmo} = {
     description => 'features that bmo needs',
@@ -427,3 +423,19 @@ META.yml: Makefile.PL
 MAKE
 }
 
+sub is_bmo_feature {
+    local $_ = shift;
+    return 1 if $OSNAME eq 'linux' && /^linux/;
+    return !m{
+        ^
+        (?: pg
+          | oracle
+          | mod_perl
+          | sqlite
+          | auth_ldap
+          | auth_radius
+          | smtp_auth
+          | updates)
+        $
+    }mxs;
+}
index 09fd8085045c387205882961ce8b8c5f8ebfd493..73406be56cea624bbbe63a84bbe4705004bf8004 100644 (file)
@@ -55,6 +55,7 @@ use Apache2::SizeLimit;
 use ModPerl::RegistryLoader ();
 use File::Basename ();
 use File::Find ();
+use English qw(-no_match_vars $OSNAME);
 
 # This loads most of our modules.
 use Bugzilla ();
@@ -78,8 +79,9 @@ Bugzilla::CGI->compile(qw(:cgi :push));
 # is taking up more than $apache_size_limit of RAM all by itself, not counting RAM it is
 # sharing with the other httpd processes.
 my $limit = Bugzilla->localconfig->{apache_size_limit};
-if ($limit < 400_000) {
-    $limit = 400_000;
+if ($OSNAME eq 'linux' && ! eval { require Linux::Smaps }) {
+    warn "SizeLimit requires Linux::Smaps on linux. size limit set to 800MB";
+    $limit = 800_000;
 }
 Apache2::SizeLimit->set_max_unshared_size($limit);