corsepiu pushed to perl-Server-Starter (f21). "Upstream update. (..more)"
by notifications@fedoraproject.org
>From cc6d72ad9089a89ec7b14676bfaf29115389d5e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ralf=20Cors=C3=A9pius?= <corsepiu(a)fedoraproject.org>
Date: Fri, 1 May 2015 07:58:52 +0200
Subject: Upstream update.
- Reflect upstream having dropped bundling modules.
- Reflect upstream having re-added LICENCE.
- Reflect upstream having switched to Module::Build.
diff --git a/.gitignore b/.gitignore
index 2ba2233..e4c28b2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-/Server-Starter-0.25.tar.gz
+/Server-Starter-0.27.tar.gz
diff --git a/perl-Server-Starter.spec b/perl-Server-Starter.spec
index 2559d27..31e64f5 100644
--- a/perl-Server-Starter.spec
+++ b/perl-Server-Starter.spec
@@ -1,5 +1,5 @@
Name: perl-Server-Starter
-Version: 0.25
+Version: 0.27
Release: 1%{?dist}
Summary: Superdaemon for hot-deploying server programs
License: GPL+ or Artistic
@@ -10,12 +10,15 @@ BuildArch: noarch
BuildRequires: perl(Carp)
BuildRequires: perl(Exporter)
-BuildRequires: perl(ExtUtils::MakeMaker) >= 6.42
BuildRequires: perl(Fcntl)
+BuildRequires: perl(File::Basename)
+BuildRequires: perl(File::Spec)
BuildRequires: perl(Getopt::Long)
BuildRequires: perl(IO::Handle)
BuildRequires: perl(IO::Socket::UNIX)
+BuildRequires: perl(Module::Build)
BuildRequires: perl(POSIX)
+BuildRequires: perl(Pod::Usage)
BuildRequires: perl(Socket)
BuildRequires: perl(strict)
BuildRequires: perl(warnings)
@@ -23,7 +26,7 @@ BuildRequires: perl(warnings)
# For the tests
BuildRequires: perl(IO::Socket::IP)
BuildRequires: perl(Net::EmptyPort)
-BuildRequires: perl(Test::TCP) >= 2.00
+BuildRequires: perl(Test::TCP) >= 2.08
BuildRequires: perl(Test::Requires)
BuildRequires: perl(Test::SharedFork)
@@ -48,22 +51,13 @@ perl-Server-Starter's start_server script.
%prep
%setup -q -n Server-Starter-%{version}
-# Remove bundled modules
-for f in inc/Test/TCP.pm inc/IO/Socket/IP.pm inc/Net/EmptyPort.pm \
- inc/Test/SharedFork.pm; do
- pat=$(echo "$f" | sed 's,/,\\/,g;s,\.,\\.,g')
- rm $f
- sed -i -e "/$pat/d" MANIFEST
-done
%build
-# --skipdeps causes ExtUtils::AutoInstall not to try auto-installing
-# missing modules
-%{__perl} Makefile.PL INSTALLDIRS=vendor --skipdeps
-make %{?_smp_mflags}
+%{__perl} Build.PL --installdirs=vendor
+./Build
%install
-make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
+./Build install --destdir=$RPM_BUILD_ROOT --create_packlist=0
find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \;
find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \;
@@ -71,10 +65,11 @@ find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \;
%{_fixperms} $RPM_BUILD_ROOT/*
%check
-make test
+./Build test
%files
-%doc Changes README
+%doc Changes README.md
+%license LICENSE
%{perl_vendorlib}/*
%{_mandir}/man3/*
@@ -83,6 +78,12 @@ make test
%{_mandir}/man1/start_server.*
%changelog
+* Fri May 01 2015 Ralf Corsépius <corsepiu(a)fedoraproject.org> - 0.27-1
+- Upstream update.
+- Reflect upstream having dropped bundling modules.
+- Reflect upstream having re-added LICENCE.
+- Reflect upstream having switched to Module::Build.
+
* Tue Apr 07 2015 Ralf Corsépius <corsepiu(a)fedoraproject.org> - 0.25-1
- Upstream update.
- Rework spec.
diff --git a/sources b/sources
index 628286e..c84207a 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-0b94ee58578d4f5a7a7b97b0a98c90c2 Server-Starter-0.25.tar.gz
+3330f699ec30546bf105bb61c05b4105 Server-Starter-0.27.tar.gz
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/perl-Server-Starter.git/commit/?h=f21&...
9 years
corsepiu pushed to perl-Server-Starter (f21). "Upstream update. (..more)"
by notifications@fedoraproject.org
>From d90efc7074309106ebfee98e59e2b57a1d8276cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ralf=20Cors=C3=A9pius?= <corsepiu(a)fedoraproject.org>
Date: Tue, 7 Apr 2015 05:16:23 +0200
Subject: Upstream update.
- Rework spec.
- Remove bundled modules.
- Drop Fedora/RH-patches.
diff --git a/.gitignore b/.gitignore
index 48e455c..2ba2233 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-/Server-Starter-0.17.tar.gz
+/Server-Starter-0.25.tar.gz
diff --git a/Server-Starter-0.17-Fix-loading-envdir.patch b/Server-Starter-0.17-Fix-loading-envdir.patch
deleted file mode 100644
index d0b9dbf..0000000
--- a/Server-Starter-0.17-Fix-loading-envdir.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-From 6d965848ff8905f82da0f1ac142000b12a05905e Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
-Date: Mon, 16 Jun 2014 17:25:08 +0200
-Subject: [PATCH 2/2] Fix loading envdir
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The envdir was scanned each second regardless of signal received. This
-caused random failures of the 'removed env' t/07-envdir.t test.
-
-This patch fixes it by loading the environment only just before
-intended restart. It also documents this start_server() option.
-
-Signed-off-by: Petr Písař <ppisar(a)redhat.com>
----
- lib/Server/Starter.pm | 31 ++++++++++++++++++++++---------
- 1 file changed, 22 insertions(+), 9 deletions(-)
-
-diff --git a/lib/Server/Starter.pm b/lib/Server/Starter.pm
-index 47bc18a..c171307 100644
---- a/lib/Server/Starter.pm
-+++ b/lib/Server/Starter.pm
-@@ -179,15 +179,13 @@ sub start_server {
-
- # the main loop
- my $term_signal = 0;
-- $current_worker = _start_worker($opts);
-+ my %loaded_env;
-+ $current_worker = _start_worker($opts, \%loaded_env);
- $update_status->();
- my $auto_restart_interval = 0;
- my $last_restart_time = time();
- my $restart_flag = 0;
- while (1) {
-- my %loaded_env = _reload_env();
-- my @loaded_env_keys = keys %loaded_env;
-- local @ENV{@loaded_env_keys} = map { $loaded_env{$_} } (@loaded_env_keys);
- if ($ENV{ENABLE_AUTO_RESTART}) {
- # restart workers periodically
- $auto_restart_interval = $ENV{AUTO_RESTART_INTERVAL} ||= 360;
-@@ -201,7 +199,7 @@ sub start_server {
- last if ($died_worker <= 0);
- if ($died_worker == $current_worker) {
- print STDERR "worker $died_worker died unexpectedly with status:$status, restarting\n";
-- $current_worker = _start_worker($opts);
-+ $current_worker = _start_worker($opts, \%loaded_env);
- $last_restart_time = time();
- } else {
- print STDERR "old worker $died_worker died, status:$status\n";
-@@ -232,9 +230,10 @@ sub start_server {
- }
- }
- if ($restart_flag > 1 || ($restart_flag > 0 && $num_old_workers == 0)) {
-+ %loaded_env = _reload_env();
- print STDERR "spawning a new worker (num_old_workers=$num_old_workers)\n";
- $old_workers{$current_worker} = $ENV{SERVER_STARTER_GENERATION};
-- $current_worker = _start_worker($opts);
-+ $current_worker = _start_worker($opts, \%loaded_env);
- $last_restart_time = time();
- $restart_flag = 0;
- $update_status->();
-@@ -342,7 +341,7 @@ sub _reload_env {
- }
-
- sub _start_worker {
-- my $opts = shift;
-+ my ($opts, $loaded_env) = @_;
- my $pid;
- while (1) {
- $ENV{SERVER_STARTER_GENERATION}++;
-@@ -350,6 +349,8 @@ sub _start_worker {
- die "fork(2) failed:$!"
- unless defined $pid;
- if ($pid == 0) {
-+ my @loaded_env_keys = keys %$loaded_env;
-+ @ENV{@loaded_env_keys} = map { $loaded_env->{$_} } (@loaded_env_keys);
- my @args = @{$opts->{exec}};
- # child process
- if (defined $opts->{dir}) {
-@@ -418,9 +419,21 @@ A Net::Server personality that can be run under L<Server::Starter> exists under
-
- Returns zero or more file descriptors on which the server program should call accept(2) in a hashref. Each element of the hashref is: (host:port|port|path_of_unix_socket) => file_descriptor.
-
--=item start_server
-+=item start_server(%options)
-
--Starts the superdaemon. Used by the C<start_server> script.
-+Starts the superdaemon. Used by the C<start_server> script. Options are:
-+
-+=over 4
-+
-+=item envdir
-+
-+Defines a directory whose content is added into server's environment. Each file name specifies an environment variable, the file's content specifies a value of the environment variable. Files with names starting with a dot are ignored.
-+
-+The environment directory is scanned and read only on time-based autorestart or SIGHUP signal. The first server instances have default environment. To remove an enviroment variable added before, remove the file and send the signal.
-+
-+This option is not mandatory.
-+
-+=back
-
- =back
-
---
-1.9.3
-
diff --git a/Server-Starter-0.17-Synchronize-to-PID-in-t-01-starter.t.patch b/Server-Starter-0.17-Synchronize-to-PID-in-t-01-starter.t.patch
deleted file mode 100644
index e194cf3..0000000
--- a/Server-Starter-0.17-Synchronize-to-PID-in-t-01-starter.t.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From f7d5f6bfb5e94a3ea01e53c5b69186ff7172b4bf Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
-Date: Fri, 8 Aug 2014 12:58:40 +0200
-Subject: [PATCH] Synchronize to PID in t/01-starter.t
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-There were races between various sleeps and the restarting server.
-THis patch fixes it by waiting for complete generation change in the
-status file.
-
-This fixes CPAN RT#73711.
-
-Signed-off-by: Petr Písař <ppisar(a)redhat.com>
----
- t/01-starter.t | 33 +++++++++++++++++++++++++--------
- 1 file changed, 25 insertions(+), 8 deletions(-)
-
-diff --git a/t/01-starter.t b/t/01-starter.t
-index ec671f0..1ddb925 100644
---- a/t/01-starter.t
-+++ b/t/01-starter.t
-@@ -3,7 +3,7 @@ use warnings;
-
- use File::Temp ();
- use Test::TCP;
--use Test::More tests => 28;
-+use Test::More tests => 26;
-
- use Server::Starter qw(start_server);
-
-@@ -43,14 +43,17 @@ for my $signal_on_hup ('TERM', 'USR1') {
- $buf =~ /^(\d+):/;
- my $worker_pid = $1;
- # switch to next gen
-- sleep 2;
-- my $status = get_status();
-- like(get_status(), qr/^1:\d+\n$/s, 'status before restart');
-+ my $previous_generation = get_single_generation();
-+ like($previous_generation, qr/^1:\d+\n$/s, 'status before restart');
- kill 'HUP', $server_pid;
-- sleep 3;
-- like(get_status(), qr/^1:\d+\n2:\d+$/s, 'status during restart');
-- sleep 2;
-- like(get_status(), qr/^2:\d+\n$/s, 'status after restart');
-+ my $current_generation;
-+ while (($current_generation = get_single_generation()) eq
-+ $previous_generation) {
-+ sleep 1;
-+ }
-+ diag "Server changed from <$previous_generation> ",
-+ "to <$current_generation>\n";
-+ like($current_generation, qr/^2:\d+\n$/s, 'status after restart');
- is(
- do {
- open my $fh, '<', "$tempdir/signame"
-@@ -76,7 +79,21 @@ for my $signal_on_hup ('TERM', 'USR1') {
- }
-
- sub get_status {
-+ while (! -e "$tempdir/status") {
-+ sleep 1;
-+ }
- open my $fh, '<', "$tempdir/status"
- or die "failed to open file:$tempdir/status:$!";
- do { undef $/; <$fh> };
- }
-+
-+sub get_single_generation {
-+ my $status;
-+ do {
-+ sleep 1 if defined $status;
-+ $status = get_status;
-+ } until ($status =~ /\A\d+:\d+\n\z/);
-+ chomp $status;
-+ $status;
-+}
-+
---
-1.9.3
-
diff --git a/Server-Starter-0.17-Synchronize-to-PID-in-t-05-killolddelay.t.patch b/Server-Starter-0.17-Synchronize-to-PID-in-t-05-killolddelay.t.patch
deleted file mode 100644
index 7dad7e0..0000000
--- a/Server-Starter-0.17-Synchronize-to-PID-in-t-05-killolddelay.t.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-From 046fb1328e76851a1398a624b77e746c37c62a67 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
-Date: Thu, 21 Aug 2014 14:17:25 +0200
-Subject: [PATCH] Synchronize to PID in t/05-killolddelay.t
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-There were races between various sleeps and the restarting server.
-This patch fixes it by waiting for complete generation change in the
-status file.
-
-Similar to CPAN RT#73711.
-
-Signed-off-by: Petr Písař <ppisar(a)redhat.com>
----
- t/05-killolddelay.t | 36 +++++++++++++++++++++++++-----------
- 1 file changed, 25 insertions(+), 11 deletions(-)
-
-diff --git a/t/05-killolddelay.t b/t/05-killolddelay.t
-index 19856af..457bdd9 100644
---- a/t/05-killolddelay.t
-+++ b/t/05-killolddelay.t
-@@ -3,7 +3,7 @@ use warnings;
-
- use File::Temp ();
- use Test::TCP;
--use Test::More tests => 28;
-+use Test::More tests => 26;
-
- use Server::Starter qw(start_server);
-
-@@ -45,17 +45,18 @@ for my $signal_on_hup ('TERM', 'USR1') {
- $buf =~ /^(\d+):/;
- my $worker_pid = $1;
- # switch to next gen
-- sleep 2;
-- my $status = get_status();
-- like(get_status(), qr/^1:\d+\n$/s, 'status before restart');
-+ my $previous_generation = get_single_generation();
-+ like($previous_generation, qr/^1:\d+\n$/s, 'status before restart');
- kill 'HUP', $server_pid;
-- sleep 4;
-- like(get_status(), qr/^1:\d+\n2:\d+$/s, 'status during restart');
-- # Child process has finished in 2 seconds but the parent
-- # checks and calls waitpid every second, so wait for an
-- # additional 1 second.
-- sleep 3;
-- like(get_status(), qr/^2:\d+\n$/s, 'status after restart');
-+ my $current_generation;
-+ while (($current_generation = get_single_generation()) eq
-+ $previous_generation) {
-+ sleep 1;
-+ }
-+ diag "Server changed from <$previous_generation> ",
-+ "to <$current_generation>\n";
-+
-+ like($current_generation, qr/^2:\d+\n$/s, 'status after restart');
- is(
- do {
- open my $fh, '<', "$tempdir/signame"
-@@ -81,7 +82,20 @@ for my $signal_on_hup ('TERM', 'USR1') {
- }
-
- sub get_status {
-+ while (! -e "$tempdir/status") {
-+ sleep 1;
-+ }
- open my $fh, '<', "$tempdir/status"
- or die "failed to open file:$tempdir/status:$!";
- do { undef $/; <$fh> };
- }
-+
-+sub get_single_generation {
-+ my $status;
-+ do {
-+ sleep 1 if defined $status;
-+ $status = get_status;
-+ } until ($status =~ /\A\d+:\d+\n\z/);
-+ chomp $status;
-+ $status;
-+}
---
-1.9.3
-
diff --git a/Server-Starter-0.17-Synchronize-to-PID-in-t-06-autorestart.t.patch b/Server-Starter-0.17-Synchronize-to-PID-in-t-06-autorestart.t.patch
deleted file mode 100644
index 9b4a713..0000000
--- a/Server-Starter-0.17-Synchronize-to-PID-in-t-06-autorestart.t.patch
+++ /dev/null
@@ -1,83 +0,0 @@
-From b2cee396fea96266a95a829b94cdf759d0eae76d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
-Date: Thu, 10 Jul 2014 15:37:47 +0200
-Subject: [PATCH] Synchronize to PID in t/06-autorestart.t
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-There were races between various sleeps and 4s auto_restart_interval.
-This patch replaces the sleeps by waiting for status with a single PID
-entry.
-
-Similar to CPAN RT#73711.
-
-Signed-off-by: Petr Písař <ppisar(a)redhat.com>
----
- t/06-autorestart.t | 35 +++++++++++++++++++++++++++--------
- 1 file changed, 27 insertions(+), 8 deletions(-)
-
-diff --git a/t/06-autorestart.t b/t/06-autorestart.t
-index bab9241..9401500 100644
---- a/t/06-autorestart.t
-+++ b/t/06-autorestart.t
-@@ -3,7 +3,7 @@ use warnings;
-
- use File::Temp ();
- use Test::TCP;
--use Test::More tests => 28;
-+use Test::More tests => 26;
-
- use Server::Starter qw(start_server);
-
-@@ -46,13 +46,19 @@ for my $signal_on_hup ('TERM', 'USR1') {
- $buf =~ /^(\d+):/;
- my $worker_pid = $1;
- # switch to next gen
-- sleep 2;
-- my $status = get_status();
-- like(get_status(), qr/^1:\d+\n$/s, 'status before auto-restart');
-- sleep 5;
-- like(get_status(), qr/^1:\d+\n2:\d+$/s, 'status during transient state');
-- sleep 4;
-- like(get_status(), qr/^2:\d+\n$/s, 'status after auto-restart');
-+ my $previous_generation = get_single_generation();
-+ like($previous_generation, qr/^\d+:\d+\n$/s,
-+ 'status before auto-restart');
-+ my $current_generation;
-+ while (($current_generation = get_single_generation()) eq
-+ $previous_generation) {
-+ sleep 1;
-+ }
-+ diag "Server changed from <$previous_generation> ",
-+ "to <$current_generation>\n";
-+
-+ like($current_generation, qr/^\d+:\d+\n$/s,
-+ 'status after auto-restart');
- is(
- do {
- open my $fh, '<', "$tempdir/signame"
-@@ -78,7 +84,20 @@ for my $signal_on_hup ('TERM', 'USR1') {
- }
-
- sub get_status {
-+ while (! -e "$tempdir/status") {
-+ sleep 1;
-+ }
- open my $fh, '<', "$tempdir/status"
- or die "failed to open file:$tempdir/status:$!";
- do { undef $/; <$fh> };
- }
-+
-+sub get_single_generation {
-+ my $status;
-+ do {
-+ sleep 1 if defined $status;
-+ $status = get_status;
-+ } until ($status =~ /\A\d+:\d+\n\z/);
-+ chomp $status;
-+ $status;
-+}
---
-1.9.3
-
diff --git a/Server-Starter-0.17-Synchronize-to-PID-in-t-07-envdir.t.patch b/Server-Starter-0.17-Synchronize-to-PID-in-t-07-envdir.t.patch
deleted file mode 100644
index c71590d..0000000
--- a/Server-Starter-0.17-Synchronize-to-PID-in-t-07-envdir.t.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-From 9fc8c81a018ba6cb5f3f0ad3fbc836e301468978 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
-Date: Mon, 16 Jun 2014 15:20:43 +0200
-Subject: [PATCH 1/2] Synchronize to PID in t/07-envdir.t
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The t/07-envdir.t used various sleeps to deal with races. This broke obviously
-when the timing was abnormal like on have loaded machine. This patch
-synchronizes on the status file by checking only the new worker is
-running.
-
-Similar to CPAN RT#73711.
-
-Signed-off-by: Petr Písař <ppisar(a)redhat.com>
----
- t/07-envdir-print.pl | 3 ++-
- t/07-envdir.t | 29 ++++++++++++++++++++++++++---
- 2 files changed, 28 insertions(+), 4 deletions(-)
-
-diff --git a/t/07-envdir-print.pl b/t/07-envdir-print.pl
-index 22cb01a..fb14225 100755
---- a/t/07-envdir-print.pl
-+++ b/t/07-envdir-print.pl
-@@ -11,6 +11,7 @@ use Server::Starter qw(server_ports);
- $SIG{TERM} = $SIG{USR1} = sub {
- exit 0;
- };
-+$ENV{PID} = $$;
-
- my $listener = IO::Socket::INET->new(
- Proto => 'tcp',
-@@ -21,7 +22,7 @@ $listener->fdopen((values %{server_ports()})[0], 'w')
- while (1) {
- if (my $conn = $listener->accept) {
- my $s = "";
-- for my $envkey (keys %ENV) {
-+ for my $envkey (sort keys %ENV) {
- $s .= $envkey . "=" . $ENV{$envkey} . "\n";
- }
- $conn->syswrite($s);
-diff --git a/t/07-envdir.t b/t/07-envdir.t
-index 8bf2352..2050706 100644
---- a/t/07-envdir.t
-+++ b/t/07-envdir.t
-@@ -46,13 +46,36 @@ test_tcp(
- $buf;
- };
- my $restart = sub {
-- sleep 1;
-+ sub getstatus {
-+ my ($file, $value);
-+ open($file, '<', "$tempdir/status") or return '';
-+ do { local $/ = undef; $value = <$file>; };
-+ close $file;
-+ $value // '';
-+ }
-+ sub getsinglegeneration {
-+ my $status;
-+ do {
-+ sleep 1 if defined $status;
-+ $status = getstatus;
-+ } until ($status =~ /\A\d+:\d+\n\z/);
-+ chomp $status;
-+ $status;
-+ }
-+ my $previous_generation = getsinglegeneration;
- kill "HUP", $server_pid;
-- sleep 2;
-+ my $current_generation;
-+ while (($current_generation = getsinglegeneration) eq
-+ $previous_generation) {
-+ sleep 1;
-+ }
-+ diag "Server changed from <$previous_generation> ",
-+ "to <$current_generation>\n";
- };
- # Initial worker does not read envdir
- my $buf = $fetch_env->();
-- unlike($buf, qr/^FOO=foo-value1$/m, 'changed env');
-+ unlike($buf, qr/^FOO=foo-value1$/m,
-+ 'environment not read for the first time');
- # rewrite envdir
- open my $envfh, ">", "$tempdir/env/FOO" or die $!;
- print $envfh "foo-value2";
---
-1.9.3
-
diff --git a/Server-Starter-0.17-Synchronize-to-content-in-signame-file.patch b/Server-Starter-0.17-Synchronize-to-content-in-signame-file.patch
deleted file mode 100644
index 6236bea..0000000
--- a/Server-Starter-0.17-Synchronize-to-content-in-signame-file.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-From 3ec63d1650f9199d6d2b2413c7e855bc108646a4 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
-Date: Mon, 8 Sep 2014 19:03:08 +0200
-Subject: [PATCH] Synchronize to content in signame file
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-There is a race between t/06-autorestart.t and
-t/05-killolddelay-echod.pl. If t/05-killolddelay-echod.pl is not fast
-enough with writing received signal name (e.g. by adding "sleep 2;" in
-the beginning of a signal handler), the t/06-autorestart.t will get
-empty signame file and the test for the signal name will fail.
-
-This patch adds synchornization by locking the signame file.
-
-Similar to CPAN RT#73711.
-
-Signed-off-by: Petr Písař <ppisar(a)redhat.com>
----
- t/05-killolddelay-echod.pl | 3 +++
- t/06-autorestart.t | 8 ++++++--
- 2 files changed, 9 insertions(+), 2 deletions(-)
-
-diff --git a/t/05-killolddelay-echod.pl b/t/05-killolddelay-echod.pl
-index 5b48ca5..bd6be30 100755
---- a/t/05-killolddelay-echod.pl
-+++ b/t/05-killolddelay-echod.pl
-@@ -5,16 +5,19 @@ use warnings;
-
- use lib qw(blib/lib lib);
-
-+use Fcntl qw(:flock);
- use IO::Socket::INET;
- use Server::Starter qw(server_ports);
-
- my $sigfn = shift @ARGV;
- open my $sigfh, '>', $sigfn
- or die "could not open file:$sigfn:$!";
-+flock $sigfh, LOCK_EX or die "could lock file:$sigfh:$!";
-
- $SIG{TERM} = $SIG{USR1} = sub {
- my $signame = shift;
- print $sigfh $signame;
-+ flock $sigfh, LOCK_UN or die $!;
- sleep 1;
- exit 0;
- };
-diff --git a/t/06-autorestart.t b/t/06-autorestart.t
-index 9401500..58e98d1 100644
---- a/t/06-autorestart.t
-+++ b/t/06-autorestart.t
-@@ -1,6 +1,7 @@
- use strict;
- use warnings;
-
-+use Fcntl qw(:flock);
- use File::Temp ();
- use Test::TCP;
- use Test::More tests => 26;
-@@ -61,9 +62,12 @@ for my $signal_on_hup ('TERM', 'USR1') {
- 'status after auto-restart');
- is(
- do {
-- open my $fh, '<', "$tempdir/signame"
-+ open my $fh, '+<', "$tempdir/signame"
- or die $!;
-- <$fh>;
-+ flock $fh, LOCK_EX or die $!;
-+ my $signal = <$fh>;
-+ flock $fh, LOCK_UN or die $!;
-+ $signal;
- },
- $signal_on_hup,
- 'signal sent on hup',
---
-1.9.3
-
diff --git a/perl-Server-Starter.spec b/perl-Server-Starter.spec
index 6a5bbf4..7ad89af 100644
--- a/perl-Server-Starter.spec
+++ b/perl-Server-Starter.spec
@@ -1,41 +1,36 @@
Name: perl-Server-Starter
-Version: 0.17
-Release: 9%{?dist}
+Version: 0.25
+Release: 1%{?dist}
Summary: Superdaemon for hot-deploying server programs
License: GPL+ or Artistic
Group: Development/Libraries
URL: http://search.cpan.org/dist/Server-Starter/
Source0: http://www.cpan.org/authors/id/K/KA/KAZUHO/Server-Starter-%{version}.tar.gz
-# Fix t/07-envdir.t race, bug #1100158, CPAN RT#73711
-Patch0: Server-Starter-0.17-Synchronize-to-PID-in-t-07-envdir.t.patch
-# Fix loading the environment directory, bug #1100158, CPAN RT#73711
-Patch1: Server-Starter-0.17-Fix-loading-envdir.patch
-# Fix t/06-autorestart.t race, bug #1100158, CPAN RT#73711
-Patch2: Server-Starter-0.17-Synchronize-to-PID-in-t-06-autorestart.t.patch
-# Fix t/01-starter.t race, bug #1100158, CPAN RT#73711
-Patch3: Server-Starter-0.17-Synchronize-to-PID-in-t-01-starter.t.patch
-# Fix t/05-killolddelay.t race, bug #1100158, CPAN RT#73711
-Patch4: Server-Starter-0.17-Synchronize-to-PID-in-t-05-killolddelay.t.patch
-# Fix a race between t/06-autorestart.t and t/05-killolddelay-echod.pl,
-# bug #1100158, CPAN RT#73711
-Patch5: Server-Starter-0.17-Synchronize-to-content-in-signame-file.patch
BuildArch: noarch
+BuildRequires: perl(Carp)
+BuildRequires: perl(Exporter)
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.42
+BuildRequires: perl(Fcntl)
BuildRequires: perl(Getopt::Long)
-BuildRequires: perl(List::MoreUtils)
-BuildRequires: perl(Proc::Wait3)
-BuildRequires: perl(Scope::Guard)
+BuildRequires: perl(IO::Handle)
+BuildRequires: perl(IO::Socket::UNIX)
+BuildRequires: perl(POSIX)
+BuildRequires: perl(Socket)
+BuildRequires: perl(strict)
+BuildRequires: perl(warnings)
+
# For the tests
-BuildRequires: perl(Fcntl)
+BuildRequires: perl(IO::Socket::IP)
+BuildRequires: perl(Net::EmptyPort)
BuildRequires: perl(Test::TCP) >= 2.00
+BuildRequires: perl(Test::Requires)
+BuildRequires: perl(Test::SharedFork)
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
%package start_server
Summary: perl-Server-Starter start_server script
-# FIXME: This doesn't make much sense. If at all, then this should be
-# Requires: perl(Server::Starter) = perl-version(Server::Starter)
Requires: perl-Server-Starter = %{version}-%{release}
%description
@@ -53,12 +48,13 @@ perl-Server-Starter's start_server script.
%prep
%setup -q -n Server-Starter-%{version}
-%patch0 -p1
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
+# Remove bundled modules
+for f in inc/Test/TCP.pm inc/IO/Socket/IP.pm inc/Net/EmptyPort.pm \
+ inc/Test/SharedFork.pm; do
+ pat=$(echo "$f" | sed 's,/,\\/,g;s,\.,\\.,g')
+ rm $f
+ sed -i -e "/$pat/d" MANIFEST
+done
%build
# --skipdeps causes ExtUtils::AutoInstall not to try auto-installing
@@ -67,8 +63,6 @@ perl-Server-Starter's start_server script.
make %{?_smp_mflags}
%install
-rm -rf $RPM_BUILD_ROOT
-
make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \;
@@ -89,6 +83,12 @@ make test
%{_mandir}/man1/start_server.*
%changelog
+* Tue Apr 07 2015 Ralf Corsépius <corsepiu(a)fedoraproject.org> - 0.25-1
+- Upstream update.
+- Rework spec.
+- Remove bundled modules.
+- Drop Fedora/RH-patches.
+
* Tue Sep 09 2014 Jitka Plesnikova <jplesnik(a)redhat.com> - 0.17-9
- Perl 5.20 mass
diff --git a/sources b/sources
index 5088c35..628286e 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-c08d2e7d93c60b0c6def9db09b3b2426 Server-Starter-0.17.tar.gz
+0b94ee58578d4f5a7a7b97b0a98c90c2 Server-Starter-0.25.tar.gz
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/perl-Server-Starter.git/commit/?h=f21&...
9 years
corsepiu pushed to perl-Server-Starter (f21). "Cleanup merger."
by notifications@fedoraproject.org
>From 73cf168cef27a68a21f9e98ac5714ac68b506c2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ralf=20Cors=C3=A9pius?= <corsepiu(a)fedoraproject.org>
Date: Tue, 7 Apr 2015 05:36:58 +0200
Subject: Cleanup merger.
diff --git a/perl-Server-Starter.spec b/perl-Server-Starter.spec
index 7ad89af..2559d27 100644
--- a/perl-Server-Starter.spec
+++ b/perl-Server-Starter.spec
@@ -89,25 +89,6 @@ make test
- Remove bundled modules.
- Drop Fedora/RH-patches.
-* Tue Sep 09 2014 Jitka Plesnikova <jplesnik(a)redhat.com> - 0.17-9
-- Perl 5.20 mass
-
-* Tue Sep 09 2014 Petr Pisar <ppisar(a)redhat.com> - 0.17-8
-- Fix a race between t/06-autorestart.t and t/05-killolddelay-echod.pl
- (bug #1100158)
-
-* Fri Aug 29 2014 Jitka Plesnikova <jplesnik(a)redhat.com> - 0.17-7
-- Perl 5.20 rebuild
-
-* Thu Aug 21 2014 Petr Pisar <ppisar(a)redhat.com> - 0.17-6
-- Fix t/05-killolddelay.t race (bug #1100158)
-
-* Fri Aug 08 2014 Petr Pisar <ppisar(a)redhat.com> - 0.17-5
-- Fix t/01-starter.t race (bug #1100158)
-
-* Thu Jul 10 2014 Petr Pisar <ppisar(a)redhat.com> - 0.17-4
-- Fix t/06-autorestart.t race (bug #1100158)
-
* Tue Jun 17 2014 Petr Pisar <ppisar(a)redhat.com> - 0.17-3
- Fix races in t/07-envdir.t test (bug #1100158)
- Load the environment directory just before restartin a server (bug #1100158)
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/perl-Server-Starter.git/commit/?h=f21&...
9 years
corsepiu pushed to perl-Server-Starter (f21). "Perl 5.20 mass"
by notifications@fedoraproject.org
>From c6687a5aad848164dcb463f6c7cb663d74298b0d Mon Sep 17 00:00:00 2001
From: Jitka Plesnikova <jplesnik(a)redhat.com>
Date: Tue, 9 Sep 2014 11:18:30 +0200
Subject: Perl 5.20 mass
diff --git a/perl-Server-Starter.spec b/perl-Server-Starter.spec
index 3250263..6a5bbf4 100644
--- a/perl-Server-Starter.spec
+++ b/perl-Server-Starter.spec
@@ -1,6 +1,6 @@
Name: perl-Server-Starter
Version: 0.17
-Release: 8%{?dist}
+Release: 9%{?dist}
Summary: Superdaemon for hot-deploying server programs
License: GPL+ or Artistic
Group: Development/Libraries
@@ -89,6 +89,9 @@ make test
%{_mandir}/man1/start_server.*
%changelog
+* Tue Sep 09 2014 Jitka Plesnikova <jplesnik(a)redhat.com> - 0.17-9
+- Perl 5.20 mass
+
* Tue Sep 09 2014 Petr Pisar <ppisar(a)redhat.com> - 0.17-8
- Fix a race between t/06-autorestart.t and t/05-killolddelay-echod.pl
(bug #1100158)
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/perl-Server-Starter.git/commit/?h=f21&...
9 years
corsepiu pushed to perl-Server-Starter (f21). "Fix a race between t/06-autorestart.t and t/05-killolddelay-echod.pl"
by notifications@fedoraproject.org
>From 7574b5e18b53d95184ddeea00fc381173334b08c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
Date: Tue, 9 Sep 2014 09:17:13 +0200
Subject: Fix a race between t/06-autorestart.t and t/05-killolddelay-echod.pl
diff --git a/Server-Starter-0.17-Synchronize-to-content-in-signame-file.patch b/Server-Starter-0.17-Synchronize-to-content-in-signame-file.patch
new file mode 100644
index 0000000..6236bea
--- /dev/null
+++ b/Server-Starter-0.17-Synchronize-to-content-in-signame-file.patch
@@ -0,0 +1,78 @@
+From 3ec63d1650f9199d6d2b2413c7e855bc108646a4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
+Date: Mon, 8 Sep 2014 19:03:08 +0200
+Subject: [PATCH] Synchronize to content in signame file
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+There is a race between t/06-autorestart.t and
+t/05-killolddelay-echod.pl. If t/05-killolddelay-echod.pl is not fast
+enough with writing received signal name (e.g. by adding "sleep 2;" in
+the beginning of a signal handler), the t/06-autorestart.t will get
+empty signame file and the test for the signal name will fail.
+
+This patch adds synchornization by locking the signame file.
+
+Similar to CPAN RT#73711.
+
+Signed-off-by: Petr Písař <ppisar(a)redhat.com>
+---
+ t/05-killolddelay-echod.pl | 3 +++
+ t/06-autorestart.t | 8 ++++++--
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/t/05-killolddelay-echod.pl b/t/05-killolddelay-echod.pl
+index 5b48ca5..bd6be30 100755
+--- a/t/05-killolddelay-echod.pl
++++ b/t/05-killolddelay-echod.pl
+@@ -5,16 +5,19 @@ use warnings;
+
+ use lib qw(blib/lib lib);
+
++use Fcntl qw(:flock);
+ use IO::Socket::INET;
+ use Server::Starter qw(server_ports);
+
+ my $sigfn = shift @ARGV;
+ open my $sigfh, '>', $sigfn
+ or die "could not open file:$sigfn:$!";
++flock $sigfh, LOCK_EX or die "could lock file:$sigfh:$!";
+
+ $SIG{TERM} = $SIG{USR1} = sub {
+ my $signame = shift;
+ print $sigfh $signame;
++ flock $sigfh, LOCK_UN or die $!;
+ sleep 1;
+ exit 0;
+ };
+diff --git a/t/06-autorestart.t b/t/06-autorestart.t
+index 9401500..58e98d1 100644
+--- a/t/06-autorestart.t
++++ b/t/06-autorestart.t
+@@ -1,6 +1,7 @@
+ use strict;
+ use warnings;
+
++use Fcntl qw(:flock);
+ use File::Temp ();
+ use Test::TCP;
+ use Test::More tests => 26;
+@@ -61,9 +62,12 @@ for my $signal_on_hup ('TERM', 'USR1') {
+ 'status after auto-restart');
+ is(
+ do {
+- open my $fh, '<', "$tempdir/signame"
++ open my $fh, '+<', "$tempdir/signame"
+ or die $!;
+- <$fh>;
++ flock $fh, LOCK_EX or die $!;
++ my $signal = <$fh>;
++ flock $fh, LOCK_UN or die $!;
++ $signal;
+ },
+ $signal_on_hup,
+ 'signal sent on hup',
+--
+1.9.3
+
diff --git a/perl-Server-Starter.spec b/perl-Server-Starter.spec
index dd3fc01..3250263 100644
--- a/perl-Server-Starter.spec
+++ b/perl-Server-Starter.spec
@@ -1,6 +1,6 @@
Name: perl-Server-Starter
Version: 0.17
-Release: 7%{?dist}
+Release: 8%{?dist}
Summary: Superdaemon for hot-deploying server programs
License: GPL+ or Artistic
Group: Development/Libraries
@@ -16,6 +16,9 @@ Patch2: Server-Starter-0.17-Synchronize-to-PID-in-t-06-autorestart.t.pat
Patch3: Server-Starter-0.17-Synchronize-to-PID-in-t-01-starter.t.patch
# Fix t/05-killolddelay.t race, bug #1100158, CPAN RT#73711
Patch4: Server-Starter-0.17-Synchronize-to-PID-in-t-05-killolddelay.t.patch
+# Fix a race between t/06-autorestart.t and t/05-killolddelay-echod.pl,
+# bug #1100158, CPAN RT#73711
+Patch5: Server-Starter-0.17-Synchronize-to-content-in-signame-file.patch
BuildArch: noarch
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.42
@@ -24,6 +27,7 @@ BuildRequires: perl(List::MoreUtils)
BuildRequires: perl(Proc::Wait3)
BuildRequires: perl(Scope::Guard)
# For the tests
+BuildRequires: perl(Fcntl)
BuildRequires: perl(Test::TCP) >= 2.00
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
@@ -54,6 +58,7 @@ perl-Server-Starter's start_server script.
%patch2 -p1
%patch3 -p1
%patch4 -p1
+%patch5 -p1
%build
# --skipdeps causes ExtUtils::AutoInstall not to try auto-installing
@@ -84,6 +89,10 @@ make test
%{_mandir}/man1/start_server.*
%changelog
+* Tue Sep 09 2014 Petr Pisar <ppisar(a)redhat.com> - 0.17-8
+- Fix a race between t/06-autorestart.t and t/05-killolddelay-echod.pl
+ (bug #1100158)
+
* Fri Aug 29 2014 Jitka Plesnikova <jplesnik(a)redhat.com> - 0.17-7
- Perl 5.20 rebuild
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/perl-Server-Starter.git/commit/?h=f21&...
9 years
corsepiu pushed to perl-Server-Starter (f21). "Perl 5.20 rebuild"
by notifications@fedoraproject.org
>From 42030f939001108679762dad9db1383909d02eed Mon Sep 17 00:00:00 2001
From: Jitka Plesnikova <jplesnik(a)redhat.com>
Date: Fri, 29 Aug 2014 12:42:06 +0200
Subject: Perl 5.20 rebuild
diff --git a/perl-Server-Starter.spec b/perl-Server-Starter.spec
index 4e07142..dd3fc01 100644
--- a/perl-Server-Starter.spec
+++ b/perl-Server-Starter.spec
@@ -1,6 +1,6 @@
Name: perl-Server-Starter
Version: 0.17
-Release: 6%{?dist}
+Release: 7%{?dist}
Summary: Superdaemon for hot-deploying server programs
License: GPL+ or Artistic
Group: Development/Libraries
@@ -84,6 +84,9 @@ make test
%{_mandir}/man1/start_server.*
%changelog
+* Fri Aug 29 2014 Jitka Plesnikova <jplesnik(a)redhat.com> - 0.17-7
+- Perl 5.20 rebuild
+
* Thu Aug 21 2014 Petr Pisar <ppisar(a)redhat.com> - 0.17-6
- Fix t/05-killolddelay.t race (bug #1100158)
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/perl-Server-Starter.git/commit/?h=f21&...
9 years
corsepiu pushed to perl-Server-Starter (f21). "Fix t/01-starter.t race (bug #1100158)"
by notifications@fedoraproject.org
>From d91e73c54b5928ed1ce5601b4ebdfb91e437d334 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
Date: Thu, 21 Aug 2014 14:23:35 +0200
Subject: Fix t/01-starter.t race (bug #1100158)
diff --git a/Server-Starter-0.17-Synchronize-to-PID-in-t-05-killolddelay.t.patch b/Server-Starter-0.17-Synchronize-to-PID-in-t-05-killolddelay.t.patch
new file mode 100644
index 0000000..7dad7e0
--- /dev/null
+++ b/Server-Starter-0.17-Synchronize-to-PID-in-t-05-killolddelay.t.patch
@@ -0,0 +1,85 @@
+From 046fb1328e76851a1398a624b77e746c37c62a67 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
+Date: Thu, 21 Aug 2014 14:17:25 +0200
+Subject: [PATCH] Synchronize to PID in t/05-killolddelay.t
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+There were races between various sleeps and the restarting server.
+This patch fixes it by waiting for complete generation change in the
+status file.
+
+Similar to CPAN RT#73711.
+
+Signed-off-by: Petr Písař <ppisar(a)redhat.com>
+---
+ t/05-killolddelay.t | 36 +++++++++++++++++++++++++-----------
+ 1 file changed, 25 insertions(+), 11 deletions(-)
+
+diff --git a/t/05-killolddelay.t b/t/05-killolddelay.t
+index 19856af..457bdd9 100644
+--- a/t/05-killolddelay.t
++++ b/t/05-killolddelay.t
+@@ -3,7 +3,7 @@ use warnings;
+
+ use File::Temp ();
+ use Test::TCP;
+-use Test::More tests => 28;
++use Test::More tests => 26;
+
+ use Server::Starter qw(start_server);
+
+@@ -45,17 +45,18 @@ for my $signal_on_hup ('TERM', 'USR1') {
+ $buf =~ /^(\d+):/;
+ my $worker_pid = $1;
+ # switch to next gen
+- sleep 2;
+- my $status = get_status();
+- like(get_status(), qr/^1:\d+\n$/s, 'status before restart');
++ my $previous_generation = get_single_generation();
++ like($previous_generation, qr/^1:\d+\n$/s, 'status before restart');
+ kill 'HUP', $server_pid;
+- sleep 4;
+- like(get_status(), qr/^1:\d+\n2:\d+$/s, 'status during restart');
+- # Child process has finished in 2 seconds but the parent
+- # checks and calls waitpid every second, so wait for an
+- # additional 1 second.
+- sleep 3;
+- like(get_status(), qr/^2:\d+\n$/s, 'status after restart');
++ my $current_generation;
++ while (($current_generation = get_single_generation()) eq
++ $previous_generation) {
++ sleep 1;
++ }
++ diag "Server changed from <$previous_generation> ",
++ "to <$current_generation>\n";
++
++ like($current_generation, qr/^2:\d+\n$/s, 'status after restart');
+ is(
+ do {
+ open my $fh, '<', "$tempdir/signame"
+@@ -81,7 +82,20 @@ for my $signal_on_hup ('TERM', 'USR1') {
+ }
+
+ sub get_status {
++ while (! -e "$tempdir/status") {
++ sleep 1;
++ }
+ open my $fh, '<', "$tempdir/status"
+ or die "failed to open file:$tempdir/status:$!";
+ do { undef $/; <$fh> };
+ }
++
++sub get_single_generation {
++ my $status;
++ do {
++ sleep 1 if defined $status;
++ $status = get_status;
++ } until ($status =~ /\A\d+:\d+\n\z/);
++ chomp $status;
++ $status;
++}
+--
+1.9.3
+
diff --git a/perl-Server-Starter.spec b/perl-Server-Starter.spec
index 784a305..4e07142 100644
--- a/perl-Server-Starter.spec
+++ b/perl-Server-Starter.spec
@@ -1,6 +1,6 @@
Name: perl-Server-Starter
Version: 0.17
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: Superdaemon for hot-deploying server programs
License: GPL+ or Artistic
Group: Development/Libraries
@@ -14,6 +14,8 @@ Patch1: Server-Starter-0.17-Fix-loading-envdir.patch
Patch2: Server-Starter-0.17-Synchronize-to-PID-in-t-06-autorestart.t.patch
# Fix t/01-starter.t race, bug #1100158, CPAN RT#73711
Patch3: Server-Starter-0.17-Synchronize-to-PID-in-t-01-starter.t.patch
+# Fix t/05-killolddelay.t race, bug #1100158, CPAN RT#73711
+Patch4: Server-Starter-0.17-Synchronize-to-PID-in-t-05-killolddelay.t.patch
BuildArch: noarch
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.42
@@ -51,6 +53,7 @@ perl-Server-Starter's start_server script.
%patch1 -p1
%patch2 -p1
%patch3 -p1
+%patch4 -p1
%build
# --skipdeps causes ExtUtils::AutoInstall not to try auto-installing
@@ -81,6 +84,9 @@ make test
%{_mandir}/man1/start_server.*
%changelog
+* Thu Aug 21 2014 Petr Pisar <ppisar(a)redhat.com> - 0.17-6
+- Fix t/05-killolddelay.t race (bug #1100158)
+
* Fri Aug 08 2014 Petr Pisar <ppisar(a)redhat.com> - 0.17-5
- Fix t/01-starter.t race (bug #1100158)
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/perl-Server-Starter.git/commit/?h=f21&...
9 years
corsepiu pushed to perl-Server-Starter (f21). "Fix t/06-autorestart.t race"
by notifications@fedoraproject.org
>From a85e5520399d290537b9ba6b11e4860b41bba299 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
Date: Thu, 10 Jul 2014 15:45:21 +0200
Subject: Fix t/06-autorestart.t race
diff --git a/Server-Starter-0.17-Synchronize-to-PID-in-t-06-autorestart.t.patch b/Server-Starter-0.17-Synchronize-to-PID-in-t-06-autorestart.t.patch
new file mode 100644
index 0000000..9b4a713
--- /dev/null
+++ b/Server-Starter-0.17-Synchronize-to-PID-in-t-06-autorestart.t.patch
@@ -0,0 +1,83 @@
+From b2cee396fea96266a95a829b94cdf759d0eae76d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
+Date: Thu, 10 Jul 2014 15:37:47 +0200
+Subject: [PATCH] Synchronize to PID in t/06-autorestart.t
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+There were races between various sleeps and 4s auto_restart_interval.
+This patch replaces the sleeps by waiting for status with a single PID
+entry.
+
+Similar to CPAN RT#73711.
+
+Signed-off-by: Petr Písař <ppisar(a)redhat.com>
+---
+ t/06-autorestart.t | 35 +++++++++++++++++++++++++++--------
+ 1 file changed, 27 insertions(+), 8 deletions(-)
+
+diff --git a/t/06-autorestart.t b/t/06-autorestart.t
+index bab9241..9401500 100644
+--- a/t/06-autorestart.t
++++ b/t/06-autorestart.t
+@@ -3,7 +3,7 @@ use warnings;
+
+ use File::Temp ();
+ use Test::TCP;
+-use Test::More tests => 28;
++use Test::More tests => 26;
+
+ use Server::Starter qw(start_server);
+
+@@ -46,13 +46,19 @@ for my $signal_on_hup ('TERM', 'USR1') {
+ $buf =~ /^(\d+):/;
+ my $worker_pid = $1;
+ # switch to next gen
+- sleep 2;
+- my $status = get_status();
+- like(get_status(), qr/^1:\d+\n$/s, 'status before auto-restart');
+- sleep 5;
+- like(get_status(), qr/^1:\d+\n2:\d+$/s, 'status during transient state');
+- sleep 4;
+- like(get_status(), qr/^2:\d+\n$/s, 'status after auto-restart');
++ my $previous_generation = get_single_generation();
++ like($previous_generation, qr/^\d+:\d+\n$/s,
++ 'status before auto-restart');
++ my $current_generation;
++ while (($current_generation = get_single_generation()) eq
++ $previous_generation) {
++ sleep 1;
++ }
++ diag "Server changed from <$previous_generation> ",
++ "to <$current_generation>\n";
++
++ like($current_generation, qr/^\d+:\d+\n$/s,
++ 'status after auto-restart');
+ is(
+ do {
+ open my $fh, '<', "$tempdir/signame"
+@@ -78,7 +84,20 @@ for my $signal_on_hup ('TERM', 'USR1') {
+ }
+
+ sub get_status {
++ while (! -e "$tempdir/status") {
++ sleep 1;
++ }
+ open my $fh, '<', "$tempdir/status"
+ or die "failed to open file:$tempdir/status:$!";
+ do { undef $/; <$fh> };
+ }
++
++sub get_single_generation {
++ my $status;
++ do {
++ sleep 1 if defined $status;
++ $status = get_status;
++ } until ($status =~ /\A\d+:\d+\n\z/);
++ chomp $status;
++ $status;
++}
+--
+1.9.3
+
diff --git a/perl-Server-Starter.spec b/perl-Server-Starter.spec
index 3d0cfc4..cb1b22b 100644
--- a/perl-Server-Starter.spec
+++ b/perl-Server-Starter.spec
@@ -1,6 +1,6 @@
Name: perl-Server-Starter
Version: 0.17
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: Superdaemon for hot-deploying server programs
License: GPL+ or Artistic
Group: Development/Libraries
@@ -10,6 +10,8 @@ Source0: http://www.cpan.org/authors/id/K/KA/KAZUHO/Server-Starter-%{vers
Patch0: Server-Starter-0.17-Synchronize-to-PID-in-t-07-envdir.t.patch
# Fix loading the environment directory, bug #1100158, CPAN RT#73711
Patch1: Server-Starter-0.17-Fix-loading-envdir.patch
+# Fix t/06-autorestart.t race, bug #1100158, CPAN RT#73711
+Patch2: Server-Starter-0.17-Synchronize-to-PID-in-t-06-autorestart.t.patch
BuildArch: noarch
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.42
@@ -45,6 +47,7 @@ perl-Server-Starter's start_server script.
%setup -q -n Server-Starter-%{version}
%patch0 -p1
%patch1 -p1
+%patch2 -p1
%build
# --skipdeps causes ExtUtils::AutoInstall not to try auto-installing
@@ -75,6 +78,9 @@ make test
%{_mandir}/man1/start_server.*
%changelog
+* Thu Jul 10 2014 Petr Pisar <ppisar(a)redhat.com> - 0.17-4
+- Fix t/06-autorestart.t race (bug #1100158)
+
* Tue Jun 17 2014 Petr Pisar <ppisar(a)redhat.com> - 0.17-3
- Fix races in t/07-envdir.t test (bug #1100158)
- Load the environment directory just before restartin a server (bug #1100158)
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/perl-Server-Starter.git/commit/?h=f21&...
9 years
corsepiu pushed to perl-Server-Starter (f21). "Fix t/01-starter.t race"
by notifications@fedoraproject.org
>From 6701ab4358d00317c857d6878d1207d24cb12656 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
Date: Fri, 8 Aug 2014 13:06:27 +0200
Subject: Fix t/01-starter.t race
diff --git a/Server-Starter-0.17-Synchronize-to-PID-in-t-01-starter.t.patch b/Server-Starter-0.17-Synchronize-to-PID-in-t-01-starter.t.patch
new file mode 100644
index 0000000..e194cf3
--- /dev/null
+++ b/Server-Starter-0.17-Synchronize-to-PID-in-t-01-starter.t.patch
@@ -0,0 +1,82 @@
+From f7d5f6bfb5e94a3ea01e53c5b69186ff7172b4bf Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
+Date: Fri, 8 Aug 2014 12:58:40 +0200
+Subject: [PATCH] Synchronize to PID in t/01-starter.t
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+There were races between various sleeps and the restarting server.
+THis patch fixes it by waiting for complete generation change in the
+status file.
+
+This fixes CPAN RT#73711.
+
+Signed-off-by: Petr Písař <ppisar(a)redhat.com>
+---
+ t/01-starter.t | 33 +++++++++++++++++++++++++--------
+ 1 file changed, 25 insertions(+), 8 deletions(-)
+
+diff --git a/t/01-starter.t b/t/01-starter.t
+index ec671f0..1ddb925 100644
+--- a/t/01-starter.t
++++ b/t/01-starter.t
+@@ -3,7 +3,7 @@ use warnings;
+
+ use File::Temp ();
+ use Test::TCP;
+-use Test::More tests => 28;
++use Test::More tests => 26;
+
+ use Server::Starter qw(start_server);
+
+@@ -43,14 +43,17 @@ for my $signal_on_hup ('TERM', 'USR1') {
+ $buf =~ /^(\d+):/;
+ my $worker_pid = $1;
+ # switch to next gen
+- sleep 2;
+- my $status = get_status();
+- like(get_status(), qr/^1:\d+\n$/s, 'status before restart');
++ my $previous_generation = get_single_generation();
++ like($previous_generation, qr/^1:\d+\n$/s, 'status before restart');
+ kill 'HUP', $server_pid;
+- sleep 3;
+- like(get_status(), qr/^1:\d+\n2:\d+$/s, 'status during restart');
+- sleep 2;
+- like(get_status(), qr/^2:\d+\n$/s, 'status after restart');
++ my $current_generation;
++ while (($current_generation = get_single_generation()) eq
++ $previous_generation) {
++ sleep 1;
++ }
++ diag "Server changed from <$previous_generation> ",
++ "to <$current_generation>\n";
++ like($current_generation, qr/^2:\d+\n$/s, 'status after restart');
+ is(
+ do {
+ open my $fh, '<', "$tempdir/signame"
+@@ -76,7 +79,21 @@ for my $signal_on_hup ('TERM', 'USR1') {
+ }
+
+ sub get_status {
++ while (! -e "$tempdir/status") {
++ sleep 1;
++ }
+ open my $fh, '<', "$tempdir/status"
+ or die "failed to open file:$tempdir/status:$!";
+ do { undef $/; <$fh> };
+ }
++
++sub get_single_generation {
++ my $status;
++ do {
++ sleep 1 if defined $status;
++ $status = get_status;
++ } until ($status =~ /\A\d+:\d+\n\z/);
++ chomp $status;
++ $status;
++}
++
+--
+1.9.3
+
diff --git a/perl-Server-Starter.spec b/perl-Server-Starter.spec
index cb1b22b..784a305 100644
--- a/perl-Server-Starter.spec
+++ b/perl-Server-Starter.spec
@@ -1,6 +1,6 @@
Name: perl-Server-Starter
Version: 0.17
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: Superdaemon for hot-deploying server programs
License: GPL+ or Artistic
Group: Development/Libraries
@@ -12,6 +12,8 @@ Patch0: Server-Starter-0.17-Synchronize-to-PID-in-t-07-envdir.t.patch
Patch1: Server-Starter-0.17-Fix-loading-envdir.patch
# Fix t/06-autorestart.t race, bug #1100158, CPAN RT#73711
Patch2: Server-Starter-0.17-Synchronize-to-PID-in-t-06-autorestart.t.patch
+# Fix t/01-starter.t race, bug #1100158, CPAN RT#73711
+Patch3: Server-Starter-0.17-Synchronize-to-PID-in-t-01-starter.t.patch
BuildArch: noarch
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.42
@@ -48,6 +50,7 @@ perl-Server-Starter's start_server script.
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
%build
# --skipdeps causes ExtUtils::AutoInstall not to try auto-installing
@@ -78,6 +81,9 @@ make test
%{_mandir}/man1/start_server.*
%changelog
+* Fri Aug 08 2014 Petr Pisar <ppisar(a)redhat.com> - 0.17-5
+- Fix t/01-starter.t race (bug #1100158)
+
* Thu Jul 10 2014 Petr Pisar <ppisar(a)redhat.com> - 0.17-4
- Fix t/06-autorestart.t race (bug #1100158)
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/perl-Server-Starter.git/commit/?h=f21&...
9 years
corsepiu pushed to perl-Server-Starter (f22). "Upstream update. (..more)"
by notifications@fedoraproject.org
>From 96b6f5340aaf906e870d20b95d546801de03c587 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ralf=20Cors=C3=A9pius?= <corsepiu(a)fedoraproject.org>
Date: Tue, 7 Apr 2015 05:16:23 +0200
Subject: Upstream update.
- Rework spec.
- Remove bundled modules.
- Drop Fedora/RH-patches.
diff --git a/.gitignore b/.gitignore
index 48e455c..2ba2233 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-/Server-Starter-0.17.tar.gz
+/Server-Starter-0.25.tar.gz
diff --git a/Server-Starter-0.17-Fix-loading-envdir.patch b/Server-Starter-0.17-Fix-loading-envdir.patch
deleted file mode 100644
index d0b9dbf..0000000
--- a/Server-Starter-0.17-Fix-loading-envdir.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-From 6d965848ff8905f82da0f1ac142000b12a05905e Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
-Date: Mon, 16 Jun 2014 17:25:08 +0200
-Subject: [PATCH 2/2] Fix loading envdir
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The envdir was scanned each second regardless of signal received. This
-caused random failures of the 'removed env' t/07-envdir.t test.
-
-This patch fixes it by loading the environment only just before
-intended restart. It also documents this start_server() option.
-
-Signed-off-by: Petr Písař <ppisar(a)redhat.com>
----
- lib/Server/Starter.pm | 31 ++++++++++++++++++++++---------
- 1 file changed, 22 insertions(+), 9 deletions(-)
-
-diff --git a/lib/Server/Starter.pm b/lib/Server/Starter.pm
-index 47bc18a..c171307 100644
---- a/lib/Server/Starter.pm
-+++ b/lib/Server/Starter.pm
-@@ -179,15 +179,13 @@ sub start_server {
-
- # the main loop
- my $term_signal = 0;
-- $current_worker = _start_worker($opts);
-+ my %loaded_env;
-+ $current_worker = _start_worker($opts, \%loaded_env);
- $update_status->();
- my $auto_restart_interval = 0;
- my $last_restart_time = time();
- my $restart_flag = 0;
- while (1) {
-- my %loaded_env = _reload_env();
-- my @loaded_env_keys = keys %loaded_env;
-- local @ENV{@loaded_env_keys} = map { $loaded_env{$_} } (@loaded_env_keys);
- if ($ENV{ENABLE_AUTO_RESTART}) {
- # restart workers periodically
- $auto_restart_interval = $ENV{AUTO_RESTART_INTERVAL} ||= 360;
-@@ -201,7 +199,7 @@ sub start_server {
- last if ($died_worker <= 0);
- if ($died_worker == $current_worker) {
- print STDERR "worker $died_worker died unexpectedly with status:$status, restarting\n";
-- $current_worker = _start_worker($opts);
-+ $current_worker = _start_worker($opts, \%loaded_env);
- $last_restart_time = time();
- } else {
- print STDERR "old worker $died_worker died, status:$status\n";
-@@ -232,9 +230,10 @@ sub start_server {
- }
- }
- if ($restart_flag > 1 || ($restart_flag > 0 && $num_old_workers == 0)) {
-+ %loaded_env = _reload_env();
- print STDERR "spawning a new worker (num_old_workers=$num_old_workers)\n";
- $old_workers{$current_worker} = $ENV{SERVER_STARTER_GENERATION};
-- $current_worker = _start_worker($opts);
-+ $current_worker = _start_worker($opts, \%loaded_env);
- $last_restart_time = time();
- $restart_flag = 0;
- $update_status->();
-@@ -342,7 +341,7 @@ sub _reload_env {
- }
-
- sub _start_worker {
-- my $opts = shift;
-+ my ($opts, $loaded_env) = @_;
- my $pid;
- while (1) {
- $ENV{SERVER_STARTER_GENERATION}++;
-@@ -350,6 +349,8 @@ sub _start_worker {
- die "fork(2) failed:$!"
- unless defined $pid;
- if ($pid == 0) {
-+ my @loaded_env_keys = keys %$loaded_env;
-+ @ENV{@loaded_env_keys} = map { $loaded_env->{$_} } (@loaded_env_keys);
- my @args = @{$opts->{exec}};
- # child process
- if (defined $opts->{dir}) {
-@@ -418,9 +419,21 @@ A Net::Server personality that can be run under L<Server::Starter> exists under
-
- Returns zero or more file descriptors on which the server program should call accept(2) in a hashref. Each element of the hashref is: (host:port|port|path_of_unix_socket) => file_descriptor.
-
--=item start_server
-+=item start_server(%options)
-
--Starts the superdaemon. Used by the C<start_server> script.
-+Starts the superdaemon. Used by the C<start_server> script. Options are:
-+
-+=over 4
-+
-+=item envdir
-+
-+Defines a directory whose content is added into server's environment. Each file name specifies an environment variable, the file's content specifies a value of the environment variable. Files with names starting with a dot are ignored.
-+
-+The environment directory is scanned and read only on time-based autorestart or SIGHUP signal. The first server instances have default environment. To remove an enviroment variable added before, remove the file and send the signal.
-+
-+This option is not mandatory.
-+
-+=back
-
- =back
-
---
-1.9.3
-
diff --git a/Server-Starter-0.17-Synchronize-to-PID-in-t-01-starter.t.patch b/Server-Starter-0.17-Synchronize-to-PID-in-t-01-starter.t.patch
deleted file mode 100644
index e194cf3..0000000
--- a/Server-Starter-0.17-Synchronize-to-PID-in-t-01-starter.t.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From f7d5f6bfb5e94a3ea01e53c5b69186ff7172b4bf Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
-Date: Fri, 8 Aug 2014 12:58:40 +0200
-Subject: [PATCH] Synchronize to PID in t/01-starter.t
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-There were races between various sleeps and the restarting server.
-THis patch fixes it by waiting for complete generation change in the
-status file.
-
-This fixes CPAN RT#73711.
-
-Signed-off-by: Petr Písař <ppisar(a)redhat.com>
----
- t/01-starter.t | 33 +++++++++++++++++++++++++--------
- 1 file changed, 25 insertions(+), 8 deletions(-)
-
-diff --git a/t/01-starter.t b/t/01-starter.t
-index ec671f0..1ddb925 100644
---- a/t/01-starter.t
-+++ b/t/01-starter.t
-@@ -3,7 +3,7 @@ use warnings;
-
- use File::Temp ();
- use Test::TCP;
--use Test::More tests => 28;
-+use Test::More tests => 26;
-
- use Server::Starter qw(start_server);
-
-@@ -43,14 +43,17 @@ for my $signal_on_hup ('TERM', 'USR1') {
- $buf =~ /^(\d+):/;
- my $worker_pid = $1;
- # switch to next gen
-- sleep 2;
-- my $status = get_status();
-- like(get_status(), qr/^1:\d+\n$/s, 'status before restart');
-+ my $previous_generation = get_single_generation();
-+ like($previous_generation, qr/^1:\d+\n$/s, 'status before restart');
- kill 'HUP', $server_pid;
-- sleep 3;
-- like(get_status(), qr/^1:\d+\n2:\d+$/s, 'status during restart');
-- sleep 2;
-- like(get_status(), qr/^2:\d+\n$/s, 'status after restart');
-+ my $current_generation;
-+ while (($current_generation = get_single_generation()) eq
-+ $previous_generation) {
-+ sleep 1;
-+ }
-+ diag "Server changed from <$previous_generation> ",
-+ "to <$current_generation>\n";
-+ like($current_generation, qr/^2:\d+\n$/s, 'status after restart');
- is(
- do {
- open my $fh, '<', "$tempdir/signame"
-@@ -76,7 +79,21 @@ for my $signal_on_hup ('TERM', 'USR1') {
- }
-
- sub get_status {
-+ while (! -e "$tempdir/status") {
-+ sleep 1;
-+ }
- open my $fh, '<', "$tempdir/status"
- or die "failed to open file:$tempdir/status:$!";
- do { undef $/; <$fh> };
- }
-+
-+sub get_single_generation {
-+ my $status;
-+ do {
-+ sleep 1 if defined $status;
-+ $status = get_status;
-+ } until ($status =~ /\A\d+:\d+\n\z/);
-+ chomp $status;
-+ $status;
-+}
-+
---
-1.9.3
-
diff --git a/Server-Starter-0.17-Synchronize-to-PID-in-t-05-killolddelay.t.patch b/Server-Starter-0.17-Synchronize-to-PID-in-t-05-killolddelay.t.patch
deleted file mode 100644
index 7dad7e0..0000000
--- a/Server-Starter-0.17-Synchronize-to-PID-in-t-05-killolddelay.t.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-From 046fb1328e76851a1398a624b77e746c37c62a67 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
-Date: Thu, 21 Aug 2014 14:17:25 +0200
-Subject: [PATCH] Synchronize to PID in t/05-killolddelay.t
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-There were races between various sleeps and the restarting server.
-This patch fixes it by waiting for complete generation change in the
-status file.
-
-Similar to CPAN RT#73711.
-
-Signed-off-by: Petr Písař <ppisar(a)redhat.com>
----
- t/05-killolddelay.t | 36 +++++++++++++++++++++++++-----------
- 1 file changed, 25 insertions(+), 11 deletions(-)
-
-diff --git a/t/05-killolddelay.t b/t/05-killolddelay.t
-index 19856af..457bdd9 100644
---- a/t/05-killolddelay.t
-+++ b/t/05-killolddelay.t
-@@ -3,7 +3,7 @@ use warnings;
-
- use File::Temp ();
- use Test::TCP;
--use Test::More tests => 28;
-+use Test::More tests => 26;
-
- use Server::Starter qw(start_server);
-
-@@ -45,17 +45,18 @@ for my $signal_on_hup ('TERM', 'USR1') {
- $buf =~ /^(\d+):/;
- my $worker_pid = $1;
- # switch to next gen
-- sleep 2;
-- my $status = get_status();
-- like(get_status(), qr/^1:\d+\n$/s, 'status before restart');
-+ my $previous_generation = get_single_generation();
-+ like($previous_generation, qr/^1:\d+\n$/s, 'status before restart');
- kill 'HUP', $server_pid;
-- sleep 4;
-- like(get_status(), qr/^1:\d+\n2:\d+$/s, 'status during restart');
-- # Child process has finished in 2 seconds but the parent
-- # checks and calls waitpid every second, so wait for an
-- # additional 1 second.
-- sleep 3;
-- like(get_status(), qr/^2:\d+\n$/s, 'status after restart');
-+ my $current_generation;
-+ while (($current_generation = get_single_generation()) eq
-+ $previous_generation) {
-+ sleep 1;
-+ }
-+ diag "Server changed from <$previous_generation> ",
-+ "to <$current_generation>\n";
-+
-+ like($current_generation, qr/^2:\d+\n$/s, 'status after restart');
- is(
- do {
- open my $fh, '<', "$tempdir/signame"
-@@ -81,7 +82,20 @@ for my $signal_on_hup ('TERM', 'USR1') {
- }
-
- sub get_status {
-+ while (! -e "$tempdir/status") {
-+ sleep 1;
-+ }
- open my $fh, '<', "$tempdir/status"
- or die "failed to open file:$tempdir/status:$!";
- do { undef $/; <$fh> };
- }
-+
-+sub get_single_generation {
-+ my $status;
-+ do {
-+ sleep 1 if defined $status;
-+ $status = get_status;
-+ } until ($status =~ /\A\d+:\d+\n\z/);
-+ chomp $status;
-+ $status;
-+}
---
-1.9.3
-
diff --git a/Server-Starter-0.17-Synchronize-to-PID-in-t-06-autorestart.t.patch b/Server-Starter-0.17-Synchronize-to-PID-in-t-06-autorestart.t.patch
deleted file mode 100644
index 9b4a713..0000000
--- a/Server-Starter-0.17-Synchronize-to-PID-in-t-06-autorestart.t.patch
+++ /dev/null
@@ -1,83 +0,0 @@
-From b2cee396fea96266a95a829b94cdf759d0eae76d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
-Date: Thu, 10 Jul 2014 15:37:47 +0200
-Subject: [PATCH] Synchronize to PID in t/06-autorestart.t
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-There were races between various sleeps and 4s auto_restart_interval.
-This patch replaces the sleeps by waiting for status with a single PID
-entry.
-
-Similar to CPAN RT#73711.
-
-Signed-off-by: Petr Písař <ppisar(a)redhat.com>
----
- t/06-autorestart.t | 35 +++++++++++++++++++++++++++--------
- 1 file changed, 27 insertions(+), 8 deletions(-)
-
-diff --git a/t/06-autorestart.t b/t/06-autorestart.t
-index bab9241..9401500 100644
---- a/t/06-autorestart.t
-+++ b/t/06-autorestart.t
-@@ -3,7 +3,7 @@ use warnings;
-
- use File::Temp ();
- use Test::TCP;
--use Test::More tests => 28;
-+use Test::More tests => 26;
-
- use Server::Starter qw(start_server);
-
-@@ -46,13 +46,19 @@ for my $signal_on_hup ('TERM', 'USR1') {
- $buf =~ /^(\d+):/;
- my $worker_pid = $1;
- # switch to next gen
-- sleep 2;
-- my $status = get_status();
-- like(get_status(), qr/^1:\d+\n$/s, 'status before auto-restart');
-- sleep 5;
-- like(get_status(), qr/^1:\d+\n2:\d+$/s, 'status during transient state');
-- sleep 4;
-- like(get_status(), qr/^2:\d+\n$/s, 'status after auto-restart');
-+ my $previous_generation = get_single_generation();
-+ like($previous_generation, qr/^\d+:\d+\n$/s,
-+ 'status before auto-restart');
-+ my $current_generation;
-+ while (($current_generation = get_single_generation()) eq
-+ $previous_generation) {
-+ sleep 1;
-+ }
-+ diag "Server changed from <$previous_generation> ",
-+ "to <$current_generation>\n";
-+
-+ like($current_generation, qr/^\d+:\d+\n$/s,
-+ 'status after auto-restart');
- is(
- do {
- open my $fh, '<', "$tempdir/signame"
-@@ -78,7 +84,20 @@ for my $signal_on_hup ('TERM', 'USR1') {
- }
-
- sub get_status {
-+ while (! -e "$tempdir/status") {
-+ sleep 1;
-+ }
- open my $fh, '<', "$tempdir/status"
- or die "failed to open file:$tempdir/status:$!";
- do { undef $/; <$fh> };
- }
-+
-+sub get_single_generation {
-+ my $status;
-+ do {
-+ sleep 1 if defined $status;
-+ $status = get_status;
-+ } until ($status =~ /\A\d+:\d+\n\z/);
-+ chomp $status;
-+ $status;
-+}
---
-1.9.3
-
diff --git a/Server-Starter-0.17-Synchronize-to-PID-in-t-07-envdir.t.patch b/Server-Starter-0.17-Synchronize-to-PID-in-t-07-envdir.t.patch
deleted file mode 100644
index c71590d..0000000
--- a/Server-Starter-0.17-Synchronize-to-PID-in-t-07-envdir.t.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-From 9fc8c81a018ba6cb5f3f0ad3fbc836e301468978 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
-Date: Mon, 16 Jun 2014 15:20:43 +0200
-Subject: [PATCH 1/2] Synchronize to PID in t/07-envdir.t
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The t/07-envdir.t used various sleeps to deal with races. This broke obviously
-when the timing was abnormal like on have loaded machine. This patch
-synchronizes on the status file by checking only the new worker is
-running.
-
-Similar to CPAN RT#73711.
-
-Signed-off-by: Petr Písař <ppisar(a)redhat.com>
----
- t/07-envdir-print.pl | 3 ++-
- t/07-envdir.t | 29 ++++++++++++++++++++++++++---
- 2 files changed, 28 insertions(+), 4 deletions(-)
-
-diff --git a/t/07-envdir-print.pl b/t/07-envdir-print.pl
-index 22cb01a..fb14225 100755
---- a/t/07-envdir-print.pl
-+++ b/t/07-envdir-print.pl
-@@ -11,6 +11,7 @@ use Server::Starter qw(server_ports);
- $SIG{TERM} = $SIG{USR1} = sub {
- exit 0;
- };
-+$ENV{PID} = $$;
-
- my $listener = IO::Socket::INET->new(
- Proto => 'tcp',
-@@ -21,7 +22,7 @@ $listener->fdopen((values %{server_ports()})[0], 'w')
- while (1) {
- if (my $conn = $listener->accept) {
- my $s = "";
-- for my $envkey (keys %ENV) {
-+ for my $envkey (sort keys %ENV) {
- $s .= $envkey . "=" . $ENV{$envkey} . "\n";
- }
- $conn->syswrite($s);
-diff --git a/t/07-envdir.t b/t/07-envdir.t
-index 8bf2352..2050706 100644
---- a/t/07-envdir.t
-+++ b/t/07-envdir.t
-@@ -46,13 +46,36 @@ test_tcp(
- $buf;
- };
- my $restart = sub {
-- sleep 1;
-+ sub getstatus {
-+ my ($file, $value);
-+ open($file, '<', "$tempdir/status") or return '';
-+ do { local $/ = undef; $value = <$file>; };
-+ close $file;
-+ $value // '';
-+ }
-+ sub getsinglegeneration {
-+ my $status;
-+ do {
-+ sleep 1 if defined $status;
-+ $status = getstatus;
-+ } until ($status =~ /\A\d+:\d+\n\z/);
-+ chomp $status;
-+ $status;
-+ }
-+ my $previous_generation = getsinglegeneration;
- kill "HUP", $server_pid;
-- sleep 2;
-+ my $current_generation;
-+ while (($current_generation = getsinglegeneration) eq
-+ $previous_generation) {
-+ sleep 1;
-+ }
-+ diag "Server changed from <$previous_generation> ",
-+ "to <$current_generation>\n";
- };
- # Initial worker does not read envdir
- my $buf = $fetch_env->();
-- unlike($buf, qr/^FOO=foo-value1$/m, 'changed env');
-+ unlike($buf, qr/^FOO=foo-value1$/m,
-+ 'environment not read for the first time');
- # rewrite envdir
- open my $envfh, ">", "$tempdir/env/FOO" or die $!;
- print $envfh "foo-value2";
---
-1.9.3
-
diff --git a/Server-Starter-0.17-Synchronize-to-content-in-signame-file.patch b/Server-Starter-0.17-Synchronize-to-content-in-signame-file.patch
deleted file mode 100644
index 6236bea..0000000
--- a/Server-Starter-0.17-Synchronize-to-content-in-signame-file.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-From 3ec63d1650f9199d6d2b2413c7e855bc108646a4 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
-Date: Mon, 8 Sep 2014 19:03:08 +0200
-Subject: [PATCH] Synchronize to content in signame file
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-There is a race between t/06-autorestart.t and
-t/05-killolddelay-echod.pl. If t/05-killolddelay-echod.pl is not fast
-enough with writing received signal name (e.g. by adding "sleep 2;" in
-the beginning of a signal handler), the t/06-autorestart.t will get
-empty signame file and the test for the signal name will fail.
-
-This patch adds synchornization by locking the signame file.
-
-Similar to CPAN RT#73711.
-
-Signed-off-by: Petr Písař <ppisar(a)redhat.com>
----
- t/05-killolddelay-echod.pl | 3 +++
- t/06-autorestart.t | 8 ++++++--
- 2 files changed, 9 insertions(+), 2 deletions(-)
-
-diff --git a/t/05-killolddelay-echod.pl b/t/05-killolddelay-echod.pl
-index 5b48ca5..bd6be30 100755
---- a/t/05-killolddelay-echod.pl
-+++ b/t/05-killolddelay-echod.pl
-@@ -5,16 +5,19 @@ use warnings;
-
- use lib qw(blib/lib lib);
-
-+use Fcntl qw(:flock);
- use IO::Socket::INET;
- use Server::Starter qw(server_ports);
-
- my $sigfn = shift @ARGV;
- open my $sigfh, '>', $sigfn
- or die "could not open file:$sigfn:$!";
-+flock $sigfh, LOCK_EX or die "could lock file:$sigfh:$!";
-
- $SIG{TERM} = $SIG{USR1} = sub {
- my $signame = shift;
- print $sigfh $signame;
-+ flock $sigfh, LOCK_UN or die $!;
- sleep 1;
- exit 0;
- };
-diff --git a/t/06-autorestart.t b/t/06-autorestart.t
-index 9401500..58e98d1 100644
---- a/t/06-autorestart.t
-+++ b/t/06-autorestart.t
-@@ -1,6 +1,7 @@
- use strict;
- use warnings;
-
-+use Fcntl qw(:flock);
- use File::Temp ();
- use Test::TCP;
- use Test::More tests => 26;
-@@ -61,9 +62,12 @@ for my $signal_on_hup ('TERM', 'USR1') {
- 'status after auto-restart');
- is(
- do {
-- open my $fh, '<', "$tempdir/signame"
-+ open my $fh, '+<', "$tempdir/signame"
- or die $!;
-- <$fh>;
-+ flock $fh, LOCK_EX or die $!;
-+ my $signal = <$fh>;
-+ flock $fh, LOCK_UN or die $!;
-+ $signal;
- },
- $signal_on_hup,
- 'signal sent on hup',
---
-1.9.3
-
diff --git a/perl-Server-Starter.spec b/perl-Server-Starter.spec
index 6a5bbf4..7ad89af 100644
--- a/perl-Server-Starter.spec
+++ b/perl-Server-Starter.spec
@@ -1,41 +1,36 @@
Name: perl-Server-Starter
-Version: 0.17
-Release: 9%{?dist}
+Version: 0.25
+Release: 1%{?dist}
Summary: Superdaemon for hot-deploying server programs
License: GPL+ or Artistic
Group: Development/Libraries
URL: http://search.cpan.org/dist/Server-Starter/
Source0: http://www.cpan.org/authors/id/K/KA/KAZUHO/Server-Starter-%{version}.tar.gz
-# Fix t/07-envdir.t race, bug #1100158, CPAN RT#73711
-Patch0: Server-Starter-0.17-Synchronize-to-PID-in-t-07-envdir.t.patch
-# Fix loading the environment directory, bug #1100158, CPAN RT#73711
-Patch1: Server-Starter-0.17-Fix-loading-envdir.patch
-# Fix t/06-autorestart.t race, bug #1100158, CPAN RT#73711
-Patch2: Server-Starter-0.17-Synchronize-to-PID-in-t-06-autorestart.t.patch
-# Fix t/01-starter.t race, bug #1100158, CPAN RT#73711
-Patch3: Server-Starter-0.17-Synchronize-to-PID-in-t-01-starter.t.patch
-# Fix t/05-killolddelay.t race, bug #1100158, CPAN RT#73711
-Patch4: Server-Starter-0.17-Synchronize-to-PID-in-t-05-killolddelay.t.patch
-# Fix a race between t/06-autorestart.t and t/05-killolddelay-echod.pl,
-# bug #1100158, CPAN RT#73711
-Patch5: Server-Starter-0.17-Synchronize-to-content-in-signame-file.patch
BuildArch: noarch
+BuildRequires: perl(Carp)
+BuildRequires: perl(Exporter)
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.42
+BuildRequires: perl(Fcntl)
BuildRequires: perl(Getopt::Long)
-BuildRequires: perl(List::MoreUtils)
-BuildRequires: perl(Proc::Wait3)
-BuildRequires: perl(Scope::Guard)
+BuildRequires: perl(IO::Handle)
+BuildRequires: perl(IO::Socket::UNIX)
+BuildRequires: perl(POSIX)
+BuildRequires: perl(Socket)
+BuildRequires: perl(strict)
+BuildRequires: perl(warnings)
+
# For the tests
-BuildRequires: perl(Fcntl)
+BuildRequires: perl(IO::Socket::IP)
+BuildRequires: perl(Net::EmptyPort)
BuildRequires: perl(Test::TCP) >= 2.00
+BuildRequires: perl(Test::Requires)
+BuildRequires: perl(Test::SharedFork)
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
%package start_server
Summary: perl-Server-Starter start_server script
-# FIXME: This doesn't make much sense. If at all, then this should be
-# Requires: perl(Server::Starter) = perl-version(Server::Starter)
Requires: perl-Server-Starter = %{version}-%{release}
%description
@@ -53,12 +48,13 @@ perl-Server-Starter's start_server script.
%prep
%setup -q -n Server-Starter-%{version}
-%patch0 -p1
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
+# Remove bundled modules
+for f in inc/Test/TCP.pm inc/IO/Socket/IP.pm inc/Net/EmptyPort.pm \
+ inc/Test/SharedFork.pm; do
+ pat=$(echo "$f" | sed 's,/,\\/,g;s,\.,\\.,g')
+ rm $f
+ sed -i -e "/$pat/d" MANIFEST
+done
%build
# --skipdeps causes ExtUtils::AutoInstall not to try auto-installing
@@ -67,8 +63,6 @@ perl-Server-Starter's start_server script.
make %{?_smp_mflags}
%install
-rm -rf $RPM_BUILD_ROOT
-
make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \;
@@ -89,6 +83,12 @@ make test
%{_mandir}/man1/start_server.*
%changelog
+* Tue Apr 07 2015 Ralf Corsépius <corsepiu(a)fedoraproject.org> - 0.25-1
+- Upstream update.
+- Rework spec.
+- Remove bundled modules.
+- Drop Fedora/RH-patches.
+
* Tue Sep 09 2014 Jitka Plesnikova <jplesnik(a)redhat.com> - 0.17-9
- Perl 5.20 mass
diff --git a/sources b/sources
index 5088c35..628286e 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-c08d2e7d93c60b0c6def9db09b3b2426 Server-Starter-0.17.tar.gz
+0b94ee58578d4f5a7a7b97b0a98c90c2 Server-Starter-0.25.tar.gz
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/perl-Server-Starter.git/commit/?h=f22&...
9 years