| To: | Ken McDonell <kenj@xxxxxxxxxxxxxxxx> |
|---|---|
| Subject: | Re: pmlogger: fetch.c: changed & PMCD_ADD_AGENT: |
| From: | Dave Brolley <brolley@xxxxxxxxxx> |
| Date: | Thu, 23 Jun 2016 16:29:34 -0400 |
| Cc: | "'PCP Mailing List'" <pcp@xxxxxxxxxxx> |
| Delivered-to: | pcp@xxxxxxxxxxx |
| In-reply-to: | <013301d1cb8d$4c9d2790$e5d776b0$@internode.on.net> |
| References: | <574C98EE.9010504@xxxxxxxxxx> <013301d1cb8d$4c9d2790$e5d776b0$@internode.on.net> |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 |
On 06/21/2016 03:19 AM, Ken McDonell wrote: Hmmmm. I may have jumped the gun. The loop (in myFetch) exists only to handle the case that both the error PDU (with error code >0) and the response pdu are sent. Nothing is written until myFetch returns to the caller (do_work in callback.c).-----Original Message----- From: Dave Brolley [mailto:brolley@xxxxxxxxxx] 1. I'm looking at the code in src/pmlogger/src/fetch.c where 'if (changed & PMCD_ADD_AGENT)' is handled. It seems to me that this test which adds a mark record in the case a pmda (re)starts (outside the loop which handles the received pdus) is too late, since pdus representing several potentially changed/reset metrics may have been erroneously logged before then. Should the test not be made, and the mark record not be generated inside the loop at the point at which the change is first noticed?I think the code is wrong. The protocol is ... -> client send request <- pmcd sends error pdu with error code > 0 AND <- pmcd sends response pdu So __pmGetPDU loop in fetch.c gets and decodes these in the correct order, but the test and putmark() call should be inside the loop before the pmResult is output. So I think all that I need to ensure is that the metrics are validated before any <mark> record is generated. This can be done outside the loop. I've pushed my code to git://git.pcp.io/brolley/pcp pmlogger-pmda-reconnect Dave |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | 除了B2B,参展,外贸客户开发系统轻松帮助中小型企业开拓国外客户!, ying39 |
|---|---|
| Next by Date: | Re: [pcp] PCP Bug 1100: Final Tweak + qa, Dave Brolley |
| Previous by Thread: | Re: pmlogger: fetch.c: changed & PMCD_ADD_AGENT:, Ken McDonell |
| Next by Thread: | pcp updates: pcp-ipcs, build, docs, qa, Nathan Scott |
| Indexes: | [Date] [Thread] [Top] [All Lists] |