Hi,
On RHEL 7 / PCP 3.10.6 when removing a PMDA using the pipe mechanism I
see that even after ./Remove the PMDA and the piped process are still
running. I'd expect them both getting killed. Is this a feature or a
bug or something that should be handled in the Remove script?
# pstree -Aa | grep -B 1 -A 3 '[p]mdatest'
|-pmcd -T 3
| |-perl /var/lib/pcp/pmdas/test/pmdatest.pl
| | `-datafeed /var/lib/pcp/pmdas/test/datafeed
| | `-sleep 1
| |-pmdalinux
Below is a simple reproducer, a "data producer" script, and a test
PMDA:
#!/bin/sh
while true; do
echo "DATA"
sleep 5
done
# PMDA
use strict;
use warnings;
use PCP::PMDA;
my $pmda;
my $pipecmd = "/var/lib/pcp/pmdas/test/datafeed";
sub test_pipe {
my (undef, $line) = @_;
$pmda->log("Incoming data:" . $line . ":");
}
sub test_fetch_callback {
return (PM_ERR_AGAIN, 0);
}
$pmda = PCP::PMDA->new('test', 497);
$pmda->add_metric(pmda_pmid(0, 0), PM_TYPE_STRING, 0,
PM_SEM_INSTANT, pmda_units(0,0,0,0,0,0),
'test.test', '', '');
$pmda->add_pipe($pipecmd, \&test_pipe, 0);
$pmda->set_fetch_callback(\&test_fetch_callback);
$pmda->run();
Thanks,
--
Marko Myllynen
|