Re: Unloading a CMPI provider
Kirk Augustin <[email protected]> Fri, 10 May 2013 08:41:12 -0700 (PDT)
| Newsgroups | gmane.network.open-pegasus.general |
|---|---|
| Message-ID | <[email protected]> |
Sorry that I misunderstood. The most common cause of not unloading is repeating enumertion requests by a client. Logging your own provider activity would show this. Kirk Augustin 11821 NW McNamee Rd Portland, OR 97231 HM: 503-289-4356 >________________________________ >From: Vijayalakshmi Subramanyam <[email protected]> >To: Kirk Augustin <[email protected]> >Cc: Ashok K Pathak <[email protected]>; Devchandra L Meetei <[email protected]>; "[email protected]" <[email protected]> >Sent: Thursday, May 9, 2013 10:59 PM >Subject: Re: Unloading a CMPI provider > > > >Thanks for the information Kirk. I am having the exact opposite problem. I want the provider to unload but it is not unloading. > > > > >On Thu, May 9, 2013 at 9:20 PM, Kirk Augustin <[email protected]> wrote: > >However, except for very rare conditions, in general it is a bad idea to prevent provider unloading. >>It is not just that if every provider does it, the system will run out of resources and crash. >>It is because any provider that does not unload is not being backed up, can not be shadowed or restored, and prevents the whole system from being properly maintained. >>Other than for debugging purposes, there is never really a good reason to prevent unloading. >>If you are relying on a cron type of timing activity, its timing probably should not done by a provider, but something else that wakes the provider. >>Providers are supposed to respond, not control or initiate. >>And you should never rely on volatile memory to hold on going systems information. >>You should write it out to a database and unload. >> >>Kirk Augustin >>11821 NW McNamee Rd >>Portland, OR 97231 >> >> >>HM: 503-289-4356 >> >>From: Ashok K Pathak <[email protected]> >>>To: Vijayalakshmi Subramanyam <[email protected]> >>>Cc: Devchandra L Meetei <[email protected]>; "[email protected]" <[email protected]> >>>Sent: Wednesday, May 8, 2013 10:52 PM >>> >>>Subject: Re: Unloading a CMPI provider >>> >>> >>> >>>Some times back I have discussion w/ Marek for the same issue >>>Thanks to Marek for the nice explanation to prevent unloading of CMPI >>>provider . >>> >>>For CMPI provider the way to prevent unload of your CMPI provider is to >>>implement the cleanup() function for each MI (in the provider). >>> >>>To give you an example how to do this, lets assume a provider named >>>"Example" with an InstanceMI (provides enumerateInstances etc.). >>>Assuming you use the CMPI convenience macro >>>CMInstanceMIStub( >>> Example, >>> Example, >>> _broker, >>> CMNoHook) >>> >>>You would have to implement the function: ExampleCleanup(). >>> >>>CMPIStatus ExampleCleanup( >>> CMPIInstanceMI * mi, >>> const CMPIContext * ctx, >>> CMPIBoolean terminating) >>>{ >>> if (!terminating) >>> { >>> CMReturn(CMPI_RC_NEVER_UNLOAD); >>> } >>> else >>> { >>> /* CIM Server is terminating, we HAVE to do cleanup now */ >>> } >>>} >>> >>> >>> >>> >>>C++ providers may use the CIMOMHandle::disallowProviderUnload() method to >>>remain loaded even when idle by using the disallowProviderUnload() call in >>>the initialize method of your Provider >>> >>> >>>void disallowProviderUnload() >>>Provides a hint to the CIM Server that the provider calling this method >>>prefers not to be unloaded. This hint applies in situations where a >>>provider unload is not necessary, such as when the CIM Server unloads idle >>>providers for efficiency reasons. A provider may rescind this hint by using >>>the allowProviderUnload method. Note that disallowProviderUnload is >>>cumulative, such that each call to disallowProviderUnload must be matched >>>with a call to allowProviderUnload. >>> >>>For example you can refer link >>>http://cvs.opengroup.org/cgi-bin/viewcvs.cgi/pegasus/src/Pegasus/Provider/CIMOMHandle.h >>>http://cvs.opengroup.org/cgi-bin/viewcvs.cgi/pegasus/src/Providers/slp/SLPProvider.cpp >>> >>>Regards >>>Ashok >>> >>> >>> >>> Vijayalakshmi >>> Subramanyam >>> <viji.sub87@gmail To >>> .com> Devchandra L Meetei >>> <[email protected]>, >>> 05/09/2013 09:19 cc >>> AM "[email protected]" >>> <[email protected]> >>> Subject >>> Re: Unloading a CMPI provider >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>>Hi Dev, >>> >>>I checked both the cases and there seems to be no valid reason why the >>>provider is not getting unload . >>>Is it possible that during registration of this provider , i may have set >>>some property to avoid unloading ? >>> >>>Thanks, >>>Viji >>> >>>On Wed, May 8, 2013 at 10:00 AM, Devchandra L Meetei <[email protected]> >>>wrote: >>> By Default, idle providers unload when it is idle for 5 minutes, By idle, >>> we mean, It is not processing any request. >>> >>> Another case where module will not unload is when group of provider >>> module is *cimserver*. >>> >>> So you might like to verify above two cases also. >>> >>> >>> On Wed, May 8, 2013 at 9:45 AM, Vijayalakshmi Subramanyam < >>> [email protected]> wrote: >>> Hi All, >>> >>> I have three CMPI providers in my system. Two of them unload >>> automatially when idle. >>> >>> One provider fails to unload. I do not see the terminate() call come >>> into the provider itself. I am sure there are no open subscriptions. >>> >>> I also checked that the provider is not returning CMPI_RC_DO_NOT_UNLOAD >>> or CMPI_RC_NEVER_UNLOAD in any condition. >>> >>> This is the log message that i see in the cimtrace file for this >>> provider - >>> >>> [2876:18446744073709551614:CMPILocalProviderManager.cpp:256]: >>> CMPILocalProviderManager::_provider_ctrl: >>> UNLOAD_IDLE_PROVIDERS >>> 1367898721s-801162us: ProviderManager >>> [2876:18446744073709551614:CMPILocalProviderManager.cpp:309]: Checking >>> timeout data for CMPIProvider: arcRAIDProvider15 >>> 1367898721s-801162us: ProviderManager >>> [2876:18446744073709551614:CMPILocalProviderManager.cpp:318]: >>> provider->unload_ok() returns: false >>> 1367898721s-801162us: Thread >>> [2876:18446744073709551614:ThreadPool.cpp:224]: Work finished. >>> >>> Is there something I am missing ? >>> >>> Regards, >>> Viji >>> >>> >>> >>> -- >>> Warm Regards >>> --Dev >>> OpenPegasus Developer/Committer >>> >>> (\__/) >>> (='.'=) This is Bunny. Copy and paste bunny >>> (")_(") to help him gain world domination. >>> >>> >>> >>> >>> >>> > > >