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

Thread concurrency issue in DefaultPooledObject.getIdleTimeMillis()

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.3
    • Labels:
      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-unit-test.patch
          4 kB
          Jacopo Cappellato
        2. POOL-279.patch
          0.9 kB
          Jacopo Cappellato
        3. POOL-279.patch
          0.9 kB
          Jacopo Cappellato
        4. POOL-279.patch
          0.6 kB
          Jacopo Cappellato
        5. POOL-279.patch
          5 kB
          Jacopo Cappellato

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: