Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

reaper: ensure worker can be stopped via "!want"

Now, all of our job classes may be controlled via "!want"
  • Loading branch information...
commit 6c9f5f6b73d77a348172cbcc4f79245e02801c22 1 parent 61e1d3b
Eric Wong authored
Showing with 14 additions and 1 deletion.
  1. +1 −1  lib/MogileFS/Worker/Reaper.pm
  2. +13 −0 t/00-startup.t
2  lib/MogileFS/Worker/Reaper.pm
View
@@ -155,8 +155,8 @@ sub work {
my $reap_check;
$reap_check = sub {
# get db and note we're starting a run
+ $self->parent_ping;
debug("Reaper running; looking for dead devices");
- $self->still_alive;
foreach my $dev (grep { $_->dstate->is_perm_dead }
Mgd::device_factory()->get_all)
13 t/00-startup.t
View
@@ -440,4 +440,17 @@ foreach my $t (qw(file file_on file_to_delete)) {
ok($mogc->delete("0"), "delete 0 works");
}
+# ensure all workers can be stopped/started
+{
+ my $c = IO::Socket::INET->new(PeerAddr => '127.0.0.1:7001', Timeout => 3);
+ my @jobs = qw(fsck queryworker delete replicate reaper monitor job_master);
+
+ foreach my $j (@jobs) {
+ ok(want($c, 0, $j), "shut down all $j");
+ }
+ foreach my $j (@jobs) {
+ ok(want($c, 1, $j), "start 1 $j");
+ }
+}
+
done_testing();
Please sign in to comment.
Something went wrong with that request. Please try again.