Uploaded image for project: 'Commons Pool'
  1. Commons Pool
  2. POOL-279

Thread concurrency issue in DefaultPooledObject.getIdleTimeMillis()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.2
    • 2.3
    • None

    Description

      Under unlucky thread concurrency the getIdleTimeMillis() method of DefaultPooledObject can return a negative value.
      I have attached a Junit test that fails most of the times and a simple fix, that doesn't use synchronization: with this fix the Junit test always succeed.

      Attachments

        1. POOL-279.patch
          5 kB
          Jacopo Cappellato
        2. POOL-279.patch
          0.6 kB
          Jacopo Cappellato
        3. POOL-279.patch
          0.9 kB
          Jacopo Cappellato
        4. POOL-279.patch
          0.9 kB
          Jacopo Cappellato
        5. POOL-279-unit-test.patch
          4 kB
          Jacopo Cappellato

        Activity

          People

            Unassigned Unassigned
            jacopoc Jacopo Cappellato
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: