pcp
[Top] [All Lists]

Re: [pcp] Fix Perl PMDA Socket Input

To: Nathan Scott <nathans@xxxxxxxxxx>
Subject: Re: [pcp] Fix Perl PMDA Socket Input
From: Marko Myllynen <myllynen@xxxxxxxxxx>
Date: Tue, 1 Mar 2016 23:57:11 +0200
Cc: pcp developers <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <896217520.26492556.1456867386925.JavaMail.zimbra@xxxxxxxxxx>
Organization: Red Hat
References: <56D5C45C.2050600@xxxxxxxxxx> <896217520.26492556.1456867386925.JavaMail.zimbra@xxxxxxxxxx>
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 2016-03-01 23:23, Nathan Scott wrote:
> ----- Original Message -----
>>
>> While reviewing the Perl PMDA pipe input code (basically it doesn't
>> work, I'm randomly getting empty lines or seeing lines missed which
>> never happens with the external command and tee(1)), I noticed the
>> following socket input related bug. This makes me wonder how well tested
>> the pipe/socket input mechanisms are, are they worth trying or is it
>> best to stick with the more widely used methods?
> 
> Best would be to fix the bug(s) as you've done - also good would be to
> have some modern PMDAs using the code to exercise it, and/or some more
> regression tests in the area.  :)

If still using the earlier sent pmdatest.pl but with the below script
to produce "CSV" data, I'm starting to see discrepancies in the
received data immediately - looks like the key factor is the length of
the input lines:

#!/bin/sh

echo "# Timestamp;ID;Key;Value;Type"
while true; do
  ts="A very long time timestamp here for the sake of testing"
  echo "# BOD"
  for i in $(seq 1 99); do
    echo "$ts;$i;Date;$ts$ts$ts;String"
  done
  echo "# EOD"
  sleep 5
done

And this is what the PMDA prints (obviously works ok on cmd line):

...
Info: Incoming data:A very long time timestamp here for the sake of 
testing;88;Date;A very long time timestamp here for the sake of testingA very 
long time timestamp here for the sake of testingA very long time timestamp here 
for the sake of testing;String:
Info: Incoming data:the sake of testingA very long time timestamp here for the 
sake of testingA very long time timestamp here for the sake of testing;String:
Info: Incoming data:A very long time timestamp here for the sake of 
testing;90;Date;A very long time timestamp here for the sake of testingA very 
long time timestamp here for the sake of testingA very long time timestamp here 
for the sake of testing;String:
...

Thanks,

-- 
Marko Myllynen

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