Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-994

Serious connection leak in connection pool

    XMLWordPrintable

Details

    Description

      SourceForge Submitter: schrouf .
      org.jboss.resource.connectionmanager.InternalManagedC
      onnectionPool contains a serious synchronization bug in
      method returnConnection().

      The code

      if (cl.hasPermit())
      {
      cl.grantPermit(false);
      permits.release();
      }

      has to be included into the synchronized code section
      after cls.add(cl). Otherwise it is possible that the
      returned connection will be handed out to another
      thread in getConnection() before reaching the finally
      block in returnConnection(). In this situation the
      releasing thread will call cl.grantPermit(false) on a
      connection that is already in use by another thread (
      overwriting its cl.grantPermit(true) on that connection).
      This will cause a non-execution of the semaphore
      release on next return of that connection which leads to
      a final internal semaphore permit count of 1 (no
      connection pooling at all...)

      I will fix this in Brach_3_2 and HEAD

      Attachments

        Activity

          People

            starksm64 Scott Stark (Inactive)
            sourceforge-user SourceForge legacy user (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: