You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Kristian Waagan (JIRA)" <ji...@apache.org> on 2010/06/28 09:49:50 UTC

[jira] Created: (DERBY-4717) Driver trace file isn't closed/released on physical connection close when specified with the traceFile attribute/setter

Driver trace file isn't closed/released on physical connection close when specified with the traceFile attribute/setter
-----------------------------------------------------------------------------------------------------------------------

                 Key: DERBY-4717
                 URL: https://issues.apache.org/jira/browse/DERBY-4717
             Project: Derby
          Issue Type: Bug
          Components: Network Client
    Affects Versions: 10.7.0.0
            Reporter: Kristian Waagan
            Assignee: Kristian Waagan
            Priority: Minor


When specifying a trace file with the traceFile connection URL attribute or with the data source setter method, the handle to the trace file isn't released when the physical connection is closed.
The problem may be specific to the implementations of ConnectionPoolDataSource and XADataSource, as using a plain data source doesn't involve reuse (i.e another mechanism may close the trace file handle).

Two potential problems caused by this bug:
 o resource leak  (i.e., too many file handles open)
 o trace files cannot be deleted on Windows (seen for DERBY-4709)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-4717) Driver trace file isn't closed/released on physical connection close when specified with the traceFile attribute/setter

Posted by "Lily Wei (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lily Wei updated DERBY-4717:
----------------------------

    Attachment: derby.log

Apply the patch and test it on Windows. With or without ClienBaseDataSource changes, the tests both failed with not privilege on delete data files on assertTraceFilesExistAndCanBeDeleted

[Error/failure logged at Mon Jun 28 13:04:48 PDT 2010]
junit.framework.AssertionFailedError: Delete failed
        at junit.framework.Assert.fail(Assert.java:47)
        at junit.framework.Assert.assertTrue(Assert.java:20)
        at org.apache.derbyTesting.functionTests.tests.jdbcapi.J2EEDataSourceTest$8.run(J2EEDataSour
ceTest.java:2695)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.apache.derbyTesting.functionTests.tests.jdbcapi.J2EEDataSourceTest.assertTraceFilesEx
istAndCanBeDeleted(J2EEDataSourceTest.java:2685)
        at org.apache.derbyTesting.functionTests.tests.jdbcapi.J2EEDataSourceTest.testClientTraceFil
eDSConnectionAttribute(J2EEDataSourceTest.java:2675)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)

> Driver trace file isn't closed/released on physical connection close when specified with the traceFile attribute/setter
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4717
>                 URL: https://issues.apache.org/jira/browse/DERBY-4717
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.7.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-4717-1a.diff, derby.log
>
>
> When specifying a trace file with the traceFile connection URL attribute or with the data source setter method, the handle to the trace file isn't released when the physical connection is closed.
> The problem may be specific to the implementations of ConnectionPoolDataSource and XADataSource, as using a plain data source doesn't involve reuse (i.e another mechanism may close the trace file handle).
> Two potential problems caused by this bug:
>  o resource leak  (i.e., too many file handles open)
>  o trace files cannot be deleted on Windows (seen for DERBY-4709)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-4717) Driver trace file isn't closed/released on physical connection close when specified with the traceFile attribute/setter

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan updated DERBY-4717:
-----------------------------------

    Attachment: derby-4717-1b.diff

Thanks, Lily.

Attaching revision 1b, which hopefully fixes the problem (seen on Windows).
The existing test didn't close the connection, and I forgot to change it.

> Driver trace file isn't closed/released on physical connection close when specified with the traceFile attribute/setter
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4717
>                 URL: https://issues.apache.org/jira/browse/DERBY-4717
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.7.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-4717-1a.diff, derby-4717-1b.diff, derby.log
>
>
> When specifying a trace file with the traceFile connection URL attribute or with the data source setter method, the handle to the trace file isn't released when the physical connection is closed.
> The problem may be specific to the implementations of ConnectionPoolDataSource and XADataSource, as using a plain data source doesn't involve reuse (i.e another mechanism may close the trace file handle).
> Two potential problems caused by this bug:
>  o resource leak  (i.e., too many file handles open)
>  o trace files cannot be deleted on Windows (seen for DERBY-4709)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Updated: (DERBY-4717) Driver trace file isn't closed/released on physical connection close when specified with the traceFile attribute/setter

Posted by "Dag H. Wanvik" <Da...@Sun.COM>.
"Kristian Waagan (JIRA)" <ji...@apache.org> writes:

Tested 4717-1b on Windows. Worked ok with sane classes and insane
jars.

Dag


[jira] Updated: (DERBY-4717) Driver trace file isn't closed/released on physical connection close when specified with the traceFile attribute/setter

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan updated DERBY-4717:
-----------------------------------

    Attachment: derby-4717-1a.diff

Attaching patch 1a, which consists of the following changes:

(production code)
 a) Make Derby close the trace file when the physical connection is closed and the trace file is specified using 'traceFile' (attribute or setter).
(test code)
 b) Disabled the test 'testClientMessageTextConnectionAttribute', as the test started failing when I corrected the test. It was using (ConnectionPool|XA)DataSource.getConnection() to obtain a connection. This method is not an API method, it's an artifact due to Derby's subclassing (the two mentioned data sources extend ClientBaseDataSource). DERBY-4067 trace the problem that the connection attributes are not picked up.
 c) Made the tests obtain the physical connections from data source by using the correct method (i.e. getXAConnection, getPooledConnection or getConnection).
 d) Extended the test 'testClientTraceFileDSConnectionAttribute' to also make sure the trace files can be deleted (regression test for DERBY-4717).
 e) Added 'getPhysicalConnection(Object ds)' for the cases where a physical connection is to be obtained, but the data source can be of any (Derby) type.

I need someone to test this patch on Windows, i.e. that jdbcapi.J2EEDataSourceTest.testClientTraceFileDSConnectionAttribute fails without the changes to ClientBaseDataSource.

Patch ready for review.

> Driver trace file isn't closed/released on physical connection close when specified with the traceFile attribute/setter
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4717
>                 URL: https://issues.apache.org/jira/browse/DERBY-4717
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.7.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-4717-1a.diff
>
>
> When specifying a trace file with the traceFile connection URL attribute or with the data source setter method, the handle to the trace file isn't released when the physical connection is closed.
> The problem may be specific to the implementations of ConnectionPoolDataSource and XADataSource, as using a plain data source doesn't involve reuse (i.e another mechanism may close the trace file handle).
> Two potential problems caused by this bug:
>  o resource leak  (i.e., too many file handles open)
>  o trace files cannot be deleted on Windows (seen for DERBY-4709)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (DERBY-4717) Driver trace file isn't closed/released on physical connection close when specified with the traceFile attribute/setter

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan closed DERBY-4717.
----------------------------------

    Fix Version/s: 10.4.2.1
                   10.5.3.1
                   10.6.1.1
                   10.7.0.0
       Resolution: Fixed

Thanks, Dag and Lily.

Committed and backported:
 - trunk: 959550
 - 10.6 : 959552
 - 10.5 : 959553
 - 10.4 : 959554
 

> Driver trace file isn't closed/released on physical connection close when specified with the traceFile attribute/setter
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4717
>                 URL: https://issues.apache.org/jira/browse/DERBY-4717
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.7.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>             Fix For: 10.4.2.1, 10.5.3.1, 10.6.1.1, 10.7.0.0
>
>         Attachments: derby-4717-1a.diff, derby-4717-1b.diff, derby.log
>
>
> When specifying a trace file with the traceFile connection URL attribute or with the data source setter method, the handle to the trace file isn't released when the physical connection is closed.
> The problem may be specific to the implementations of ConnectionPoolDataSource and XADataSource, as using a plain data source doesn't involve reuse (i.e another mechanism may close the trace file handle).
> Two potential problems caused by this bug:
>  o resource leak  (i.e., too many file handles open)
>  o trace files cannot be deleted on Windows (seen for DERBY-4709)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4717) Driver trace file isn't closed/released on physical connection close when specified with the traceFile attribute/setter

Posted by "Lily Wei (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12883597#action_12883597 ] 

Lily Wei commented on DERBY-4717:
---------------------------------

Thanks, Kristian and Dag. The test passed for me on Windows. Yeah!!!

> Driver trace file isn't closed/released on physical connection close when specified with the traceFile attribute/setter
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4717
>                 URL: https://issues.apache.org/jira/browse/DERBY-4717
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.7.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-4717-1a.diff, derby-4717-1b.diff, derby.log
>
>
> When specifying a trace file with the traceFile connection URL attribute or with the data source setter method, the handle to the trace file isn't released when the physical connection is closed.
> The problem may be specific to the implementations of ConnectionPoolDataSource and XADataSource, as using a plain data source doesn't involve reuse (i.e another mechanism may close the trace file handle).
> Two potential problems caused by this bug:
>  o resource leak  (i.e., too many file handles open)
>  o trace files cannot be deleted on Windows (seen for DERBY-4709)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.