You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Babak Kunze <bk...@cm-ag.de> on 2001/02/19 18:37:48 UTC

mod_jserv/7275: JServServletManager starts a new "session check thread" on each zone reload!

>Number:         7275
>Category:       mod_jserv
>Synopsis:       JServServletManager starts a new "session check thread" on each zone reload!
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jserv
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Mon Feb 19 09:40:02 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     bk@cm-ag.de
>Release:        1.3.17
>Organization:
apache
>Environment:
All machines (plattform independent)
>Description:
When JServServletManager.checkReload(JServSendError errorHanlder) decides to perform a reload it calls init(JServSendError errorHanlder) after reinstantiating the classloader! After all the work is done, a new Housekeeping thread is started.

Each time init has been called, a new housekeeping-thread is started, whether or not we allready have a housekeeper. This leads to an increasing number of threads after servlets have been refreshed several times. Since these threads continue to work as daemons without termination-condition, the environment will be populated with useless threads all doing the same thing an synchronizing on all sessions every 5 seconds!
>How-To-Repeat:
Touch the zone file of a running jserv several times and take a look at the number of threads in the VM. 
>Fix:
Include a instance variable:

	boolean haveHousekeeper = false;

Check for this flag to see, if we need a new thread or we allready have one! 

Another way is to ask the housekeeper to terminate gracefully before init() is called. The second way is more preferable, since it prevents the housekeeper to disturb the serialization of the sessions, during reinit.

>Release-Note:
>Audit-Trail:
>Unformatted:
 [In order for any reply to be added to the PR database, you need]
 [to include <ap...@Apache.Org> in the Cc line and make sure the]
 [subject line starts with the report component and number, with ]
 [or without any 'Re:' prefixes (such as "general/1098:" or      ]
 ["Re: general/1098:").  If the subject doesn't match this       ]
 [pattern, your message will be misfiled and ignored.  The       ]
 ["apbugs" address is not added to the Cc line of messages from  ]
 [the database automatically because of the potential for mail   ]
 [loops.  If you do not include this Cc, your reply may be ig-   ]
 [nored unless you are responding to an explicit request from a  ]
 [developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]