pcp
[Top] [All Lists]

Couple of small PCP python API issues

To: Stan Cox <scox@xxxxxxxxxx>
Subject: Couple of small PCP python API issues
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Sun, 23 Sep 2012 07:28:12 -0400 (EDT)
Cc: pcp@xxxxxxxxxxx
Reply-to: Nathan Scott <nathans@xxxxxxxxxx>
Hi Stan,

I was hacking on the python API recently (be afraid!  be very
afraid! ;) and noticed a couple of things I wanted to mention:

- the pmErrStr vs pmErrStr_r looks wrong - the definition of
libpcp.pmErrStr_r doesn't seem to have the correct parameters?
Not sure about the pmContext.pmErrStr call site either, looks
to be using the wrong parameters too?

- about the pmContext global locking - I think this can all be
safely removed now that the pmapi C routines all have locking?
Pretty sure there's at least one deadlock there too (pmprintf()
wrapper holds that lock for an awfully long time - if any other
python calls come in before the flush = deadlock?).  My vote is
for complete removal, and reliance on the C code locking (seems
silly to double up anyway - I suspect the python locks predate
the libpcp locking, so nowadays its not needed).

Also, could you take a look over my recent extensions in there?
I added in support for the LOGIMPORT(3) interfaces - first time
I've hacked python though, so there may well be issues - would
appreciate a review if you find some time this week.  Thanks!

Oh, I also refactored your test (707) slightly - split into two
distinct tests - just a heads up in case you have any local
modifications.  I added in 708 (or was it 709?) to exercise the
libpcp_import wrapper class.

cheers.

--
Nathan

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