db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kristian Waagan (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3596) Creation of logical connections from a pooled connection causes resource leak on the server
Date Fri, 23 May 2008 07:00:06 GMT

    [ https://issues.apache.org/jira/browse/DERBY-3596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599290#action_12599290
] 

Kristian Waagan commented on DERBY-3596:
----------------------------------------

Thanks for looking at the issue Kathey.
I'll include the Jira number in the relevant comments when I post an updated patch.

I agree that the simple fix seems less risky. I get one error when I run the regression tests
with it. The failure is in one of the new tests I wrote for JDBC statement pooling, so I have
to look into the test and also check how statement pooling is affected by the fix.

I do have some reservations about the more complex fix. Even though the approach is more optimal,
the implementation is a bit hacky due to compatibility constraints. I wonder if it would be
better to design and implement a proper mechanism at a later time.
Will we ever roll a compatibility breaking release? If not, we have to code this using version
checking and keep multiple implementations on both the client and server side.

Also, please note that there are more alternatives than the two I have suggested here. For
instance, today we have Database and XADatabase. It might be possible to introduce a PoolingDatabase,
taken we can detect when clients are indeed working with pooled connections. The difference
between this one and the current complex fix, would be that the former would map client logical
connections onto embedded logical connections, whereas the latter would map client logical
connections directly onto a single embedded physical connection. This has some implications
regarding connection state reset and object creation.


I'll work a bit more on the test failure and getting a better grip on things.
Feel free to add more comments.

> Creation of logical connections from a pooled connection causes resource leak on the
server
> -------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3596
>                 URL: https://issues.apache.org/jira/browse/DERBY-3596
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Network Server, Performance
>    Affects Versions: 10.1.3.1, 10.2.2.0, 10.3.2.1, 10.4.1.3, 10.5.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>         Attachments: complex-fix-heap.png, ConnectionPoolingBug.java, derby-3596-1a-complex_approach.diff,
derby-3596-2a-simple_approach.diff, nofix-heap.png, simple-fix-heap.png
>
>
> When using ClientConnectionPoolDataSource and connection pooling, a new connection /
transaction is created for every new logical connection, and the resources are not freed /
cleaned up in the server. They are not even cleaned up when the physical connection (ClientPooledConnection)
is closed.
> A logical connection is obtained by invoking ClientPooledConnection.getConnection().
> I have observed that if you run the repro enough times against the same server, the number
of transaction in the transaction table will be reduced now and then. I believe this is garbage
collection, but I have not investigated the problem enough to tell for sure what's going on.
> I have also seen some locks not being freed, causing timeouts in some applications. I
don't have a repro for the lock problem at this time, but it is very likely related to this
issue.
> Note that XA connections are handled differently on the server, and do probably not have
this problem.

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


Mime
View raw message