Uploaded image for project: 'JSPWiki'
  1. JSPWiki
  2. JSPWIKI-610

Too fast shutdown causes hang

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.0
    • 3.0
    • Core & storage
    • None
    • OSX 10.5.8, 2.4 GHz Core2Duo.

    Description

      Running WikiEngine.shutdown() too fast after WikiEngine initialization causes it to hang. Sample 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();
              }
              
      

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jalkanen Janne Jalkanen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: