pcp
[Top] [All Lists]

Re: [pcp] Log Import files not closed

To: Martins Innus <minnus@xxxxxxxxxxx>, pcp developers <pcp@xxxxxxxxxxx>
Subject: Re: [pcp] Log Import files not closed
From: Mark Goodwin <goodwinos@xxxxxxxxx>
Date: Sat, 20 Aug 2016 16:55:54 +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=OOeNqv7vZNHY13WSlIDHO9vocoMJAA4q/o+fHQTW3rY=; b=O4vd2MYkcq6Dl1MukI2N1KbC+aPK7uOCLgRLQNOJyXljWqQ+yL84MGgaGZ5yF8mX8L sB30a8N4NxuZ/bFcRNKIEk/3BmmykX1X7bh2WRlydA/1vW4UPA8aznkfimh0638sEMnP Pu5DvS39OTu2tJGJgGzduf+bWs2Jt2rJGK/WOZYLzmyFy5x7sj8nLqeimkT5wfRuJBfN Y4aqNnPikn9/MIxF5J9u1gd+VI9v5kMms2JJu2lV7FC3UtKobmDQFoHM/f9GSf2t/26j fvU2zRpkVzFoJD4TqjT4rWtxtaOBdiQ/5KEfUzbwvRY1V8PuYGy/GrYdqjj6/a/ngoQp SKSQ==
In-reply-to: <etPan.57b705dc.600fdbb2.2ce@xxxxxxxxxxx>
References: <etPan.57b700d6.735d2d94.2ce@xxxxxxxxxxx> <etPan.57b705dc.600fdbb2.2ce@xxxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

Thanks Martins, I'll pull that in for review and run it through QA first thing 
Monday.

Cheers


On 08/19/2016 11:12 PM, Martins Innus wrote:
Sorry, should have looked further.  This patch seems to fix it.

Thanks

Martins

diff --git a/src/libpcp_import/src/archive.c b/src/libpcp_import/src/archive.c
index 4c1a0e3..8f389ff 100644
--- a/src/libpcp_import/src/archive.c
+++ b/src/libpcp_import/src/archive.c
@@ -139,6 +139,8 @@ _pmi_end(pmi_context *current)
       */
      __pmLogPutIndex(&current->logctl, &stamp);
+ __pmLogClose(&current->logctl);
+
      current->state = CONTEXT_END;
      return 0;
  }



On August 19, 2016 at 8:51:34 AM, Martins Innus (minnus@xxxxxxxxxxx) wrote:
Hi,
Hopefully this is an easy thing Iâm missing. Iâm using the python Log Import 
api in a loop.
Basically:
log = pmi.pmiLogImport( incrementing_file_name ) âdo all the stuffâ log.pmiWrite(seconds, useconds)
del log
Over and over again. After a while, I hit an open file descriptor limit. And using lsof,
shows all the files I had ever opened, still being open. I tried a log.pmiEnd() 
in addition
to the âdel logâ with no success.
Looking through the code, it seems I need to get __pmLogClose called somehow, but I canât
seem to figure out how to do it from python.
Thanks for any suggestions on how to make this work. Thanks Martins
_______________________________________________
pcp mailing list
pcp@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/pcp

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