Skip to content

Commit 51ac92e

Browse files
authored
Bug 1445700 - apache_size_limit should be 800_000 when Linux::Smaps is not installed.
1 parent 1f043d6 commit 51ac92e

File tree

4 files changed

+42
-28
lines changed

4 files changed

+42
-28
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ main_filters: &main_filters
1616

1717
defaults:
1818
bmo_slim_image: &bmo_slim_image
19-
image: mozillabteam/bmo-slim:20180313.1
19+
image: mozillabteam/bmo-slim:20180314.1
2020
user: app
2121

2222
mysql_image: &mysql_image

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mozillabteam/bmo-slim:20180313.1
1+
FROM mozillabteam/bmo-slim:20180314.1
22

33
ARG CI
44
ARG CIRCLE_SHA1

Makefile.PL

+36-24
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,13 @@ if ( $OSNAME eq 'MSWin32' ) {
9595
$requires{'DateTime::TimeZone::Local::Win32'} = '1.64';
9696
}
9797

98-
if ( $OSNAME eq 'linux' ) {
99-
# This isn't strictly needed, but it is nice to have.
100-
# we use it to make sure jobqueue-workers exit when their parent exits.
101-
my @extra = qw(Linux::Pdeathsig);
102-
103-
# for some reason, we need these on ubuntu.
104-
push @extra, qw(
105-
Linux::Pid
98+
if ( $OSNAME eq 'linux' && -f '/etc/debian_version' ) {
99+
my @extra = qw(
106100
Test::Pod::Coverage
107101
Pod::Coverage::TrustPod
108102
Test::CPAN::Meta
109103
Test::Pod
110-
) if -f '/etc/debian_version';
104+
);
111105
$requires{$_} = 0 for @extra;
112106
}
113107

@@ -315,6 +309,22 @@ my %optional_features = (
315309
},
316310
},
317311
},
312+
linux_smaps => {
313+
description => 'Linux::Smaps for limiting memory usage',
314+
prereqs => {
315+
runtime => {
316+
requires => { 'Linux::Smaps' => '0' },
317+
}
318+
},
319+
},
320+
linux_pdeath => {
321+
description => 'Linux::Pdeathsig for a good parent/child relationships',
322+
prereqs => {
323+
runtime => {
324+
requires => { 'Linux::Pdeathsig' => 0 },
325+
},
326+
},
327+
},
318328
jobqueue => {
319329
description => 'Mail Queueing',
320330
prereqs => {
@@ -362,21 +372,7 @@ for my $file ( glob 'extensions/*/Config.pm' ) {
362372
}
363373

364374
# BMO Customization
365-
my @bmo_features = grep {
366-
!m{
367-
^
368-
(?: pg
369-
| oracle
370-
| mod_perl
371-
| sqlite
372-
| auth_ldap
373-
| auth_radius
374-
| smtp_auth
375-
| linux_pid
376-
| updates)
377-
$
378-
}mxs;
379-
} keys %optional_features;
375+
my @bmo_features = grep { is_bmo_feature($_) } keys %optional_features;
380376

381377
$optional_features{bmo} = {
382378
description => 'features that bmo needs',
@@ -427,3 +423,19 @@ META.yml: Makefile.PL
427423
MAKE
428424
}
429425

426+
sub is_bmo_feature {
427+
local $_ = shift;
428+
return 1 if $OSNAME eq 'linux' && /^linux/;
429+
return !m{
430+
^
431+
(?: pg
432+
| oracle
433+
| mod_perl
434+
| sqlite
435+
| auth_ldap
436+
| auth_radius
437+
| smtp_auth
438+
| updates)
439+
$
440+
}mxs;
441+
}

mod_perl.pl

+4-2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ BEGIN
5555
use ModPerl::RegistryLoader ();
5656
use File::Basename ();
5757
use File::Find ();
58+
use English qw(-no_match_vars $OSNAME);
5859

5960
# This loads most of our modules.
6061
use Bugzilla ();
@@ -78,8 +79,9 @@ BEGIN
7879
# is taking up more than $apache_size_limit of RAM all by itself, not counting RAM it is
7980
# sharing with the other httpd processes.
8081
my $limit = Bugzilla->localconfig->{apache_size_limit};
81-
if ($limit < 400_000) {
82-
$limit = 400_000;
82+
if ($OSNAME eq 'linux' && ! eval { require Linux::Smaps }) {
83+
warn "SizeLimit requires Linux::Smaps on linux. size limit set to 800MB";
84+
$limit = 800_000;
8385
}
8486
Apache2::SizeLimit->set_max_unshared_size($limit);
8587

0 commit comments

Comments
 (0)