Skip to content

Commit 75ce47b

Browse files
committed
Delete killtree method in Cluster.pm as it depends on Proc::ProcessTable and isn't actually used anywhere
1 parent eae235f commit 75ce47b

File tree

1 file changed

+0
-40
lines changed

1 file changed

+0
-40
lines changed

contrib/mmts/Cluster.pm

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package Cluster;
33
use strict;
44
use warnings;
55

6-
use Proc::ProcessTable;
76
use PostgresNode;
87
use TestLib;
98
use Test::More;
@@ -166,45 +165,6 @@ sub stopid
166165
return stopnode($self->{nodes}->[$idx]);
167166
}
168167

169-
sub killtree
170-
{
171-
my $root = shift;
172-
diag("killtree $root\n");
173-
174-
my $t = new Proc::ProcessTable;
175-
176-
my %parent = ();
177-
#my %cmd = ();
178-
foreach my $p (@{$t->table}) {
179-
$parent{$p->pid} = $p->ppid;
180-
# $cmd{$p->pid} = $p->cmndline;
181-
}
182-
183-
if (!defined $root) {
184-
return;
185-
}
186-
my @queue = ($root);
187-
my @killist = ();
188-
189-
while (scalar @queue) {
190-
my $victim = shift @queue;
191-
while (my ($pid, $ppid) = each %parent) {
192-
if ($ppid == $victim) {
193-
push @queue, $pid;
194-
}
195-
}
196-
diag("SIGSTOP to $victim");
197-
kill 'STOP', $victim;
198-
unshift @killist, $victim;
199-
}
200-
201-
diag("SIGKILL to " . join(' ', @killist));
202-
kill 'KILL', @killist;
203-
#foreach my $victim (@killist) {
204-
# print("kill $victim " . $cmd{$victim} . "\n");
205-
#}
206-
}
207-
208168
sub stop
209169
{
210170
my ($self, $mode) = @_;

0 commit comments

Comments
 (0)