Hmm ... there is a problem here Houston. Thanks for a curly weekend
problem, Martins.
The original pmcd <--> pmda protocol was designed to accommodate _exactly_
this sort of longish delay on pmda startup.
But when libpcp_pmda was designed, that capability was overlooked not
supported in the library (there is no convenient place for a pmda to
exercise the control at the PDU level needed, and the library has no "hook"
to do this on behalf of the pmda).
And since the Perl PMDA implementation is a wrapper around libpcp_pmda that
does not connect to pmcd until the run() method, we have no real chance of
doing this in Perl.
We need to go back to libpcp_pmda first and figure how to do this safely (my
first guess is that it requires a new variant of pmdaConnect that can be
safely called before pmdaInit and then possibly launching a worker thread
to handle NOTREADY communication with pmcd should a request arrive, then
pmdaInit cleans up the worker thread, sends READY if we've gone NOTREADY and
charges on as normal). All of this requires some more thought, some design
my argument, then an implementation. After that we can provide a Perl
implementation.
> -----Original Message-----
> From: pcp-bounces@xxxxxxxxxxx [mailto:pcp-bounces@xxxxxxxxxxx] On
> Behalf Of Martins Innus
> Sent: Saturday, 22 March 2014 6:48 AM
> To: pcp developers
> Subject: [pcp] pmcd gives up on slow starting Perl PMDA
>
> Hello,
> I've been trying to debug a problem that I can simplify down to the
> attached patch to pmdasimple.perl.
>
> Output below:
>
> Log for pmdasimple on gilmour-vm-cent65 started Fri Mar 21 14:19:50 2014
> [Fri Mar 21 14:20:00] pmdasimple(31038) Info: Got line: foo
>
> [Fri Mar 21 14:20:00] pmdasimple(31038) Critical: __pmdaSetupPDU: PMDA
> pmdasimple send creds: Broken pipe
>
> [Fri Mar 21 14:20:00] pmdasimple(31038) Error: PMDA Initialisation Failed
>
> Log finished Fri Mar 21 14:20:00 2014
>
>
>
> I see a similar error posted here:
>
> https://bugzilla.redhat.com/show_bug.cgi?format=multiple&id=1073658
>
> but don't know exactly how to deal with that in a perl pmda on startup.
>
> Background is the following. I'm working on adding to the systemtap pmda
> and need to collect information on available tap points before I decide
what
> metrics to make available. Basically a :
>
>
>
> $pmda = PCP::PMDA->new('systemtap', 88);
>
> open a pipe with stap -l 'syscall.*' and read each into a hash
>
> for each hash element loop through a whole bunch of : $pmda-
> >add_metric(....
>
> etc, etc....
>
>
>
> The stap call takes a couple seconds to run, and seems to be enough to
kill
> the pmda.
>
> I just simulate the delay with the sleep in the attached example. 10
seconds
> is extreme. 2-3 seconds seems to be enough to make it fail.
>
> Any suggestions on how to proceed?
>
> Thanks
>
> Martins
|