pcp
[Top] [All Lists]

Re: Log Import files not closed

To: pcp developers <pcp@xxxxxxxxxxx>
Subject: Re: Log Import files not closed
From: Martins Innus <minnus@xxxxxxxxxxx>
Date: Fri, 19 Aug 2016 09:12:44 -0400
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <etPan.57b700d6.735d2d94.2ce@xxxxxxxxxxx>
References: <etPan.57b700d6.735d2d94.2ce@xxxxxxxxxxx>
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

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