Re: Terminating provider process

Kirk Augustin <[email protected]> Fri, 17 May 2013 08:54:25 -0700 (PDT)
Newsgroups gmane.network.open-pegasus.general
Message-ID <[email protected]>
Not sure I am following exactly, but isn't the problem more to do with the time delay in Python unloading?
I don't think the ProviderAgent closing down can be hastened if Python itself is slow to unload.
Nor do I think there should there be a crash because the provider is called again before the ProviderAgent process has shut down.
Which is why I wonder if both problems are really coming from Python, and not the ProviderAgent?
Is it possible to watch the Python process to see if it is what is causing the delay in the ProviderAgent closing?

Kirk  Augustin
11821 NW McNamee Rd
Portland, OR 97231


HM: 503-289-4356


>________________________________
>From: Marek Szermutzky <[email protected]>
>To: Jan Safranek <[email protected]> 
>Cc: "[email protected]" <[email protected]> 
>Sent: Friday, May 17, 2013 4:49 AM
>Subject: Re: Terminating provider process
>
>
>
>Hi Jan. 
>
>
>First I want to say thank you for reporting that issue. 
>
>Thank you Jan! 
>
>Secondly, we have picked up on this specific case of behavior, but we(OpenPegasus) do not have a performing and nice solution for it right now. But you started the discussion. 
>We have this issue on our radar, we talked about it in Architecture discussion on Thursday. 
>
>
>
>Now ... lets talk technical ... (I prefer this...> =)) 
>Basically what you need is a ProviderAgent which closes down as soon as all providers have cleaned up, right ? 
>
>
>Marek 
>
>
>
>From:        Jan Safranek <[email protected]> 
>To:        "[email protected]" <[email protected]>, 
>Date:        15.05.2013 15:50 
>Subject:        Terminating provider process 
>
>>________________________________
>
>
>
>I use cmpi-bindings to write CMPI providers in Python to speed up the
>development. I noticed that Pegasus unloads providers in 15 minutes. Ok,
>that's reasonable. The provider process itself then lives for another 15
>minutes before it is destroyed.
>
>My problem is that Python cannot un-initialize itself properly and the
>next initialization in the same process crashes. So I get a crash if my
>provider gets a request in these 15 minutes when it's unloaded by the
>provider process but the provider process still exists.
>
>Would it be possible to shut down the provider process immediately when
>the last provider is unloaded? Either via (new) configuration option or
>compile-time option? I peeked at the code and it seems it's not that
>easy to do so, as ProviderAgent::unloadIdleProvidersHandler runs in a
>worker thread and I haven't found a way to signal the main thread
>(waiting in ProviderAgent::_readAndProcessRequest()) to shut down, but I
>think this can be solved.
>
>I can contribute the code if needed, I just need a bit of guidance how
>to interrupt readAndProcessRequest() in a nice way.
>
>Sure, I can keep the Python provider in memory forever, but I would like
>to destroy it if it is not used, it can take a lot of memory over time.
>
>Jan
>
>
>
>
>