Re: Terminating provider process

Marek Szermutzky <[email protected]> Fri, 17 May 2013 13:49:03 +0200
Newsgroups gmane.network.open-pegasus.general
Message-ID <OF14F9D680.FB911977-ONC1257B6E.00401463-C1257B6E.0040FC8A@de.ibm.com>
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