Adam,

I've spent some time with the code in the eclipse debugger and can consistently cause a condition where all the threads are running but no work happens. When you then suspend one of the application threads it consistently stops at line 166 in org.apache.uima.internal.util.ResourcePool (the statement "wait(aTimeout);" I have extracted the method and list it below.)

This is the call stack when I suspend one of the running, but not advancing the execution, threads:

Thread [Thread-1] (Suspended) Object.wait(long) line: not available [native method] ResourcePool.getResource(long) line: 166 AnalysisEnginePool.setResultSpecification(ResultSpecification) line: 155 MultiprocessingAnalysisEngine_impl.setResultSpecification(ResultSpecification) line: 122 MultiprocessingAnalysisEngine_impl(AnalysisEngineImplBase).process(CAS, ResultSpecification) line: 200 MultiprocessingAnalysisEngine_implTest$ProcessThread.run() line: 363
The extracted method in ResourcePool:

 public synchronized Resource getResource(long aTimeout) {
   long startTime = new Date().getTime();
   Resource resource;
   while ((resource = getResource()) == null) {
     try {
         wait(aTimeout);
     } catch (InterruptedException e) {
     }
     if (aTimeout > 0 && (new Date().getTime() - startTime) >= aTimeout) {
       // Timeout has expired
       return null;
     }
   }
   return resource;
 }

I will continue puzzling over this problem but admit to re-opening several of Doug Lea's books to renew my (never really put to use) acquaintance with the concepts,

Bill

Adam Lally wrote:
<snip/>
The second problem is eventually one test seems to go to sleep and
never wakes up - ergo I cannot complete the build.
<snip/>

That's certainly a problem.  There may be some race condition (that
particular testcase is multithreaded) that you see but we don't due to
different hardware characteristics or whatnot.

<snip/>
Any other debug support you could provide would be great, for example
if you can find out what line of  the test is hung at.

-Adam

Reply via email to