pcp
[Top] [All Lists]

pmda leftover processes after pmda removal

To: pcp developers <pcp@xxxxxxxxxxx>
Subject: pmda leftover processes after pmda removal
From: Marko Myllynen <myllynen@xxxxxxxxxx>
Date: Mon, 29 Feb 2016 21:27:04 +0200
Delivered-to: pcp@xxxxxxxxxxx
Organization: Red Hat
Reply-to: Marko Myllynen <myllynen@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0
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

<Prev in Thread] Current Thread [Next in Thread>