]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1441181 - Step 9 - use pdeathsig to prevent workers running without supervision
authorDylan William Hardison <dylan@hardison.net>
Tue, 13 Mar 2018 20:40:31 +0000 (16:40 -0400)
committerGitHub <noreply@github.com>
Tue, 13 Mar 2018 20:40:31 +0000 (16:40 -0400)
.circleci/config.yml
Dockerfile
Makefile.PL
jobqueue-worker.pl

index 7a2c62e82e55fad61dd4b35a404af67b4a1113fc..7d9cfdfde6e7a1ba206fc1d8b3d3cd9e6d1be9d5 100644 (file)
@@ -16,7 +16,7 @@ main_filters: &main_filters
 
 defaults:
   bmo_slim_image: &bmo_slim_image
-    image: mozillabteam/bmo-slim:20180225.1
+    image: mozillabteam/bmo-slim:20180313.1
     user: app
 
   mysql_image: &mysql_image
index ac101bb941ceacd69c6318df5bbb1dfa0b2c1fca..d367a80d41191087c2464f4edcea0a12f7315e41 100644 (file)
@@ -1,5 +1,4 @@
-FROM mozillabteam/bmo-slim:20180225.1
-
+FROM mozillabteam/bmo-slim:20180313.1
 
 ARG CI
 ARG CIRCLE_SHA1
index 34e4e24872c6060fdbfd8b298fc392a35547db11..d7c359bf0be9ae22cf2ab15212eb0bc29d93f974 100755 (executable)
@@ -22,6 +22,7 @@ BEGIN {
 use ExtUtils::MakeMaker 7.22;
 use File::Basename;
 use File::Spec;
+use English qw(-no_match_vars $OSNAME);
 
 BEGIN {
     if ( $ENV{BZ_SILENT_MAKEFILE} ) {
@@ -88,21 +89,25 @@ my %test_requires = (
 my %recommends = ( Safe => '2.30' );
 
 # Windows requires some additional modules.
-if ( $^O eq 'MSWin32' ) {
+if ( $OSNAME eq 'MSWin32' ) {
     $requires{'Win32'}                            = '0.35';
     $requires{'Win32::API'}                       = '0.55';
     $requires{'DateTime::TimeZone::Local::Win32'} = '1.64';
 }
 
-# for some reason, we need these on ubuntu.
-if ( $^O eq 'linux' && -f '/etc/debian_version' ) {
-    my @extra = qw(
+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
         Test::Pod::Coverage
         Pod::Coverage::TrustPod
         Test::CPAN::Meta
         Test::Pod
-    );
+    ) if -f '/etc/debian_version';
     $requires{$_} = 0 for @extra;
 }
 
index 6205e1bf4a9941fd7764a447f66a9f9acc3d2f27..b26aacdba9ef08b404adf98329b41052a763d7cf 100644 (file)
@@ -24,8 +24,9 @@ BEGIN {
 use Bugzilla::JobQueue::Worker;
 use Bugzilla::JobQueue;
 use Bugzilla;
-use English qw(-no_match_vars $PROGRAM_NAME);
+use English qw(-no_match_vars $PROGRAM_NAME $OSNAME);
 use Getopt::Long qw(:config gnu_getopt);
+use if $OSNAME eq 'linux', 'Linux::Pdeathsig', 'set_pdeathsig';
 
 BEGIN { Bugzilla->extensions }
 my $name = basename(__FILE__);
@@ -37,4 +38,10 @@ if ($name) {
     $PROGRAM_NAME = $name;
     ## use critic
 }
+
+if ($OSNAME eq 'linux') {
+    # get SIGTEMR (15) when parent exits.
+    set_pdeathsig(15);
+}
+
 Bugzilla::JobQueue::Worker->run('work');