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

[pool]NumActive goes to negative when the pool can't create more objects

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2
    • 1.5
    • None
    • Operating System: All
      Platform: All

    • 35617

    Description

      Under heavy usage on multithreaded environment, the pool start to show
      NumActive property as negative value.

      We've implemented a pool of sockets and if there is a problem creating new
      sockets after some time of successful operation, the pool starts trying to
      create new sockets but while trying to create them, it goes removing invalid
      instances from the pool and after the evictor runs, it starts to invalidate the
      objects, making the numActive property stay negative.

      I changed the class GenericObjectPoolImpl to check if _numActive property is
      bigger than Zero, before decrementing it and I'd like to know if this is ok so
      I can submit a patch. From my tests, it's working fine after checking if
      numActive is > than zero before executing numActive--.

      Daniel

      Attachments

        Activity

          People

            Unassigned Unassigned
            danielamadei@yahoo.com.br Daniel C. Amadei
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: