pcp
[Top] [All Lists]

Re: Next release update and pmdalogger merge

To: Nathan Scott <nathans@xxxxxxxxxx>
Subject: Re: Next release update and pmdalogger merge
From: David Smith <dsmith@xxxxxxxxxx>
Date: Mon, 16 May 2011 14:51:35 -0500
Cc: "Frank Ch. Eigler" <fche@xxxxxxxxxx>, Ken McDonell <kenj@xxxxxxxxxxxxxxxx>, Max Matveev <makc@xxxxxxxxx>, pcp <pcp@xxxxxxxxxxx>
In-reply-to: <1566158908.55479.1305286647155.JavaMail.root@xxxxxxxxxxxxxxxxxxxxxx>
References: <1566158908.55479.1305286647155.JavaMail.root@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Thunderbird/3.1.10
On 05/13/2011 06:37 AM, Nathan Scott wrote:
> Finally, I had some issues with the command-pipe mode of operation
> in pmdalogger ... have you seen those David/Frank?  Don't think I
> broke that with my changes, but could be wrong there - we seem to
> get EBADF always on a pipe fd read.  PCP QA test 457 shows off the
> issue, but a conf line like "pipe yes|" is enough to reproduce it.

I looked at this last Thursday, but without much resolution.

There is a problem with 457, since the bash script it runs does 'read
book'.  The way the pmdalogger code is written, those scripts won't have
a valid stdin, so that 'read' will immediately return and the script
will exit before 457 has a chance to send it the signal.  The pipe'd
process gets started with only 1 open fd - stdout (which of course is
really our pipe).

However, even with 457 changed to use 'while true; do sleep 1; done' to
wait, I'm still not seeing the correct output from the test script.
I'll continue to debug it.

> We'll need to switch from pipe2 to something portable in that code
> (that __pmProcessCreate we discussed earlier), but be good to have
> an understanding of this issue first if possible.

The only advantage pipe2 has over pipe() is that you can set the flags
when the pipe fds are created to avoid a race condition.  We should be
able to switch to pipe() without much trouble.

-- 
David Smith
dsmith@xxxxxxxxxx
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)

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