cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
789
Views
1
Helpful
1
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: David Requena on 14-05-2013 12:36:33 PM
I seem to be unable to properly shutdown my provider. There always remain a couple dangling threads running ([LogFileTraceWriteThread] and [Thread-10]).
 
I'm shutting down the provider this way:

    public void shutdownProvider() {

        try {

            conditionShutdown =  new Condition();

            ProviderObserver observer = new ProviderObserver() {
                @Override
                public void providerChangedEvent(ProvEv[] eventList) {
                    if (eventList != null) {
                        for (ProvEv event : eventList) {
                            if (event instanceof ProvShutdownEv) {
                                conditionShutdown.set();
                            }
                        }
                    }
                }
            };

            provider.addObserver(observer);
            provider.shutdown();

            conditionShutdown.waitTrue();
            provider.removeObserver(observer);

        } catch (ResourceUnavailableException | MethodNotSupportedException e) {
            LOGGER.log(Level.SEVERE,
                    "jTAPI exception while shutting down", e);
        }
 
I'm receiving ProvShutdownEv, the condition is being set and this method exists normally without any exceptions. Neverteless those damned 2 threads remain running.
As this is being used in a webapp System.exit() is not an option and consequently the application cannot be reloaded nor the server stopped:-(
 
JTAPI ver is 8.6, CUCM is the same. Anything obvious I'm missing?
 
Thanksin advance!
David

Subject: RE: How to properly shutdown Provider?
Replied by: David Requena on 14-05-2013 01:00:48 PM
David Staudt:
The 'observers' are implemented via threads - Provider/Address/Call/Terminal observer - make sure these are all removed/disposed before shutdown.

Thanks for your reply

At this point I've removed all jTAPI functionality from the app in an attempt to isolate the problem so it is just getting a Provider on launch and shutting it down on unload.
The only providers in place are the one shown in the code above and another used for waiting for ProvInServiceEv an launch time (which I also remove after event reception).

Also, why the TraceFileWriteThread thread if I'm not doing any tracing whatsoever? I'm clueless..
 

Subject: RE: How to properly shutdown Provider?
Replied by: David Staudt on 14-05-2013 12:49:20 PM
The 'observers' are implemented via threads - Provider/Address/Call/Terminal observer - make sure these are all removed/disposed before shutdown.

Subject: RE: How to properly shutdown Provider?
Replied by: Tohru Ohzono on 14-05-2013 09:09:25 PM
Hi David,
 
TraceFileWriteThread thread will be created to output jtapi traces from dedicated thread.
This is by design from Unified CM 8.6(2).
For now, jtapi has not a reference counter for multiple provider, so the thread will remain.
(may be fixed in the future.)
 
You can prevent jtapi from creating this thread by jtapi.ini.
Please edit or add "UseLogFileTraceWriteThread=0" in jtapi.ini.
 
Please note that traces are output on the same thread as jtapi processing thread if you set this property.
This will have a little disadvantage for performance, but similar performance as Unified CM 8.6(1) or older.
 
Thanks & Regards,
Tohru
 

Subject: RE: How to properly shutdown Provider?
Replied by: David Requena on 21-05-2013 02:54:12 PM
Many thanks for your insights. Although not optimum a solution the jtapi.ini parameter does somewhat solve the issue.
Comments
royp1
Level 1
Level 1

@dstaudt, David

When the provider in-service or out-of-service events are received in ProviderChangedEvent it gives the name of the provider: e.g:

(P1-myidentifier-middlewareJTAPI) ProvOutOfServiceEv [#319996] Cause:100 CallCtlCause:0 CiscoCause:0 FeatReason:12

(P3-myidentifier-middlwareJTAPI) ProvInServiceEv [#359515] Cause:100 CallCtlCause:0 CiscoCause:0 FeatReason:12

But the shutdown event does not give any identifier:

ProvShutdownEv [#326442] Cause:100 CallCtlCause:0 CiscoCause:0 FeatReason:12

My questions is: is there a way to identify which one has been shut down, like we can tell which one has gone out of service or in-service?

My application needs to switch from one to the other when one of them goes out of service or shutdown (for some reason). 

Thanks for your help
Regards

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links