You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (Created) (JIRA)" <ji...@apache.org> on 2011/12/13 02:21:30 UTC

[jira] [Created] (POOL-197) PooledObject: risky init of lastBorrowTime & lastReturnTime

PooledObject: risky init of lastBorrowTime & lastReturnTime
-----------------------------------------------------------

                 Key: POOL-197
                 URL: https://issues.apache.org/jira/browse/POOL-197
             Project: Commons Pool
          Issue Type: Bug
            Reporter: Sebb


PooledObject inits lastBorrowTime & lastReturnTime (and createTime) using System.currentTimeMillis().

As well as being wasteful to call the System method 3 times, it's possible that the clock will change between invocations.
This could result in getActiveTimeMillis() returning non-zero active time even though the object has never been used.

Should probably init lastBorrowTime & lastReturnTime from createTime.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (POOL-197) PooledObject: risky init of lastBorrowTime & lastReturnTime

Posted by "Mark Thomas (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/POOL-197?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Thomas resolved POOL-197.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0
    
> PooledObject: risky init of lastBorrowTime & lastReturnTime
> -----------------------------------------------------------
>
>                 Key: POOL-197
>                 URL: https://issues.apache.org/jira/browse/POOL-197
>             Project: Commons Pool
>          Issue Type: Bug
>            Reporter: Sebb
>             Fix For: 2.0
>
>
> PooledObject inits lastBorrowTime & lastReturnTime (and createTime) using System.currentTimeMillis().
> As well as being wasteful to call the System method 3 times, it's possible that the clock will change between invocations.
> This could result in getActiveTimeMillis() returning non-zero active time even though the object has never been used.
> Should probably init lastBorrowTime & lastReturnTime from createTime.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira