jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sunil Pandit" <spand...@csc.com>
Subject Re: Is this defect ???
Date Mon, 09 Dec 2002 02:07:36 GMT

James
Its not CacheEventQueue but its in ElementEventQueue. Please check the
QProcessor::Run method in class org.apache.jcs.engine.control.event
.ElementEventQueue class. The current version 1.3 in the repository still
got the code in the run method which calls Thread.Destroy on receiving the
Interrupted exception.

public void run()
        {
            AbstractElementEventRunner r = null;

            while ( !destroyed )
            {
                try
                {
                    r = take();

                    if ( log.isDebugEnabled() )
                    {
                      log.debug( "r from take() = " + r );
                    }

                }
                catch ( InterruptedException e )
                {
                    // We were interrupted, so terminate gracefully.

                    this.destroy();
                }

                if ( !destroyed && r != null )
                {
                    r.run();
                }
            }

            log.info( "QProcessor exiting for " + ElementEventQueue.this );
        }
    }


                                                                                         
                         
                    James Taylor                                                         
                         
                    <james               To:     Turbine JCS Users List <turbine-jcs-user@jakarta.apache.org>
     
                    @jamestaylor.        cc:                                             
                         
                    org>                 Subject:     Re: Is this defect ???          
                            
                                                                                         
                         
                    12/05/2002                                                           
                         
                    02:53 PM                                                             
                         
                    Please                                                               
                         
                    respond to                                                           
                         
                    "Turbine JCS                                                         
                         
                    Users List"                                                          
                         
                                                                                         
                         
                                                                                         
                         




That does not appear to be the case in the current CVS (1.4)

see:

http://cvs.apache.org/viewcvs.cgi/jakarta-turbine-jcs/src/java/org/apache/jcs/engine/CacheEventQueue.java.diff?r1=1.3&r2=1.4&diff_format=h


On Thu, 2002-12-05 at 15:48, Sunil Pandit wrote:
> James
>
> QProcessor::Run method calls this.destroy in the exception handler code
> where it handles InterruptedException .
>
> Thanks
> Sunil
>
>
>

>                     James Taylor

>                     <james               To:     Turbine JCS Users List
<turbine-jcs-user@jakarta.apache.org>
>                     @jamestaylor.        cc:

>                     org>                 Subject:     Re: Is this defect
???
>

>                     12/05/2002

>                     01:54 PM

>                     Please

>                     respond to

>                     "Turbine JCS

>                     Users List"

>

>

>
>
>
>
> On Thu, 2002-12-05 at 14:43, Sunil Pandit wrote:
> > Hello JCS Users
> >
> > I came across an interesting defect in JCS .
> > During an Initialization of JCS instance when it creates a
CompositeCache
> > instance, It creates an instance of ElementEventQueue.
ElementEventQueue
> > further creates a thread in form of an instance of QProcessor.
> > This thread is never destroyed. If we test our application  under heavy
> > load we found that several of these threads remain active. This thread
is
> > created per instance of CompositeCache and therefore should be
destroyed
> > when the composite cache is disposed.
>
> Yes, ElementEventQueue.Destroy should definitely be called in
> CompositeCache.Dispose
>
> > Also there is one more defect in JCS in same context. To correct the
> above
> > defect I thought I can use  ElementEventQueue::Destroy method which
calls
> > interrupt on QProcessor. The run method for this thread calls
> > Thread::Destroy method which is unimplemented in JDK 1.4 . So we just
> > modified the run method to set the destroy flag to true on Interrupt
> event
> > so that the thread can gracefully exit.
>
> That sounds reasonable also, where exactly is Thread.destory called?
> Just want to be sure I am following you.
>
>
>
> --
> To unsubscribe, e-mail:   <
> mailto:turbine-jcs-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <
> mailto:turbine-jcs-user-help@jakarta.apache.org>
>
>
>
>
>
>
> --
> To unsubscribe, e-mail:   <
mailto:turbine-jcs-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <
mailto:turbine-jcs-user-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <
mailto:turbine-jcs-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <
mailto:turbine-jcs-user-help@jakarta.apache.org>






Mime
View raw message