Uploaded image for project: 'UIMA'
  1. UIMA
  2. UIMA-3433

UIMA-AS cleanup of semaphore testing wrong thing

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.2AS
    • Fix Version/s: 2.6.0AS
    • Component/s: Async Scaleout
    • Labels:
      None
    • Environment:

      Fails on IBM Java 7 SR5 with error saying too many permits. Earlier versions of this Java (e.g. v 6) don't give this message.

      Description

      There is a test to clear a semaphore in uima-as as part of the stop method, which does

      	// release all permits
      	  if ( semaphore != null ) {
      		  while ( semaphore.availablePermits() > 0) {
      		  		semaphore.release();
      	  	  }
      	  }
      

      Stepping through this shows that each call to release() increases (not decreases) the number of availablePermits.

      Replace with drainPermits(), which appears to be the intent.

        Attachments

          Activity

            People

            • Assignee:
              schor Marshall Schor
              Reporter:
              schor Marshall Schor
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: