pcp
[Top] [All Lists]

Re: [pcp] pcp updates: pmlogger one is important

To: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>, pcp@xxxxxxxxxxx
Subject: Re: [pcp] pcp updates: pmlogger one is important
From: Mark Goodwin <goodwinos@xxxxxxxxx>
Date: Fri, 22 Jul 2016 09:03:23 +1000
Delivered-to: pcp@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=Y4EBJkBqNVnmshs7GMjCWdQNgNwiQ1mojWBgBf6ZLIQ=; b=FfL2sUPy6Arju8Khv2EEC1sAquODxy/0TAfjdRQNupe9OhfHLeltny75Ha/u/utHtk XmD1WykhbkDfE21bh+mpkbOQN1rF2JAB7ncylbJb9Q8Xsv1SzvfQSIDn+DrxiQEvEhGk 6oITvRUJuwaBJ2d3I4JhOusiOqC79KIcU5xxFdGQLyWyz+DVJervqm06OytdLIRLoa6k IUWNE096FpaeH0GT7MkDMlEgl1baKLsw3OSsxEsZh9AvMPPdLOD8slfD6LKkQ1tBPXFY t4vcPHIL1BT/kswojrwQvR6bWkkn3zMsP2YayVKuuqmcE+xcKIR09Jq878MFmMTPA//Q 5cYQ==
In-reply-to: <579137AE.6010805@xxxxxxxxxxxxxxxx>
References: <579137AE.6010805@xxxxxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1

On 07/22/2016 06:59 AM, Ken McDonell wrote:

commit e607bbc64a18e7ad8c50503341dd3119231804e7
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Fri Jul 22 06:48:38 2016 +1000

     src/pmlogger/src/ports.c: fix broken logic for primary control file
This was the root cause of the qa/1108 failures. The logic that checked for and stopped more than one primary pmlogger
     from running was broken.  Specifically using stat() instead of
     lstat() to check for a symbolic link will always fail, which drove
     us down the "old-style hardlink" path and unconditionally removed
     $PCP_TMP_DIR/pmlogger/primary before the existance check that was
     intended to stop multiple primary loggers from running.
This error seems to have been introduced in commit 7148bf11 (almost
     12 months ago) ... sigh.


     /*
      * make sure control port files are removed when pmlogger terminates
@@ -539,15 +606,15 @@ init_ports(void)
         * normally an upgrade will restart pmlogger and atexit(cleanup) will
         * have been run, which will remove legacy hardlinks.
         */
-       if (stat(linkfile, &sbuf) == 0 && !S_ISLNK(sbuf.st_mode)) {
+      if (lstat(linkfile, &sbuf) == 0 && !S_ISLNK(sbuf.st_mode)) {

wow, such a stupid mistake of mine - 12 months ago. Thanks for finding it Ken,
I owe you a beer or three next time we catch up

Cheers
-- Mark

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