[ 
https://issues.apache.org/jira/browse/JSPWIKI-610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12778201#action_12778201
 ] 

Andrew Jaquith commented on JSPWIKI-610:
----------------------------------------

On my perpetual "to-do" list has been investigating turning our 
WikiBackgroundThread class into a JMX TimerMBean. This would eliminate the need 
to separate threads, which has resulted in odd side-effects like these.

> Too fast shutdown causes hang
> -----------------------------
>
>                 Key: JSPWIKI-610
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-610
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Core & storage
>    Affects Versions: 3.0
>         Environment: OSX 10.5.8, 2.4 GHz Core2Duo.
>            Reporter: Janne Jalkanen
>            Priority: Minor
>
> Running WikiEngine.shutdown() too fast after WikiEngine initialization causes 
> it to hang.  Sample code.
> {code}
>         WikiEngine engine = null;
>         try
>         {
>             engine = WikiEngine.getInstance( new 
> MockServletContext("JSPWiki"), props );
>         }
>         catch( Exception e )
>         {
>             System.err.println("Error starting JSPWiki: "+e.getMessage());
>             e.printStackTrace( System.err );
>             System.exit(5);
>         }
> //        Thread.sleep(10);
>         
>         try
>         {
>             ContentManager mgr = engine.getContentManager();
>         }
>         finally
>         {
>             engine.shutdown();
>         }
>         
> {code}
> Depending on whether the Thread.sleep() is commented in or out this hangs or 
> passes.  My guess is that it's a race condition with some of the Threads that 
> we start.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to