pcp
[Top] [All Lists]

Re: pmcd restart race condition

To: Martins Innus <minnus@xxxxxxxxxxx>
Subject: Re: pmcd restart race condition
From: fche@xxxxxxxxxx (Frank Ch. Eigler)
Date: Fri, 02 Oct 2015 14:53:12 -0400
Cc: pcp developers <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <560EB93A.6020606@xxxxxxxxxxx> (Martins Innus's message of "Fri, 2 Oct 2015 13:04:58 -0400")
References: <560EB93A.6020606@xxxxxxxxxxx>
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)
Martins Innus <minnus@xxxxxxxxxxx> writes:

>     I'm seeing some sort of race condition that I haven't been able to
> track down.  If you create a bunch of
> /var/lib/pcp/pmdas/<pmda>/.NeedInstall files and then restart pmcd,
> sometimes, but not always, all the pmda/pmcd logs are gone, and only
> the .prev versions remain [...]

> As far as I can tell, when you have more than one .NeedInstall file,
> the pmcd restart process gets nested/recursive/happens multiple times
> or something.  This is on Centos 7 and current git pcp.

That's a very good point. /etc/rc.d/pmcd == /usr/share/pcp/lib/pmcd
_pmda_setup() is run in the background, just after the initial pmcd
process is started.  Those _pmda_setup()s can call to multiple pmda
Install scripts in some sequence.  Some of those Install scripts
restart pmcd via the same rc script, so nestedness and concurrency
is easily possible.

Perhaps the NeedInstall machinery should be removed entirely from
the pmcd rc script, and let the rpm %post-install (or equivalents)
handle them.

- FChE

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