pcp
[Top] [All Lists]

Fix Perl PMDA Socket Input

To: pcp developers <pcp@xxxxxxxxxxx>
Subject: Fix Perl PMDA Socket Input
From: Marko Myllynen <myllynen@xxxxxxxxxx>
Date: Tue, 1 Mar 2016 18:33:32 +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,

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? (I see, for example,
that the pipe input mechanism has only three in-tree users and those
PMDAs haven't been touched for years.)

---
 src/perl/PMDA/local.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/perl/PMDA/local.c b/src/perl/PMDA/local.c
index cc9956b..6d6f8c9 100644
--- a/src/perl/PMDA/local.c
+++ b/src/perl/PMDA/local.c
@@ -343,7 +343,7 @@ local_connection(files_t *file)
 {
     if (file->type == FILE_TAIL)
        local_log_rotated(file);
-    else if (file->type == FILE_TAIL)
+    else if (file->type == FILE_SOCK)
        local_reconnector(file);
 }


Thanks,

-- 
Marko Myllynen

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