db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-5937) File handle is leaked when a Slave replication is shutdown with failover=true
Date Mon, 08 Oct 2012 09:06:03 GMT

     [ https://issues.apache.org/jira/browse/DERBY-5937?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Knut Anders Hatlen updated DERBY-5937:

    Attachment: d5937-3a-test-datasource.diff

The new test case hangs forever when run on Java 5. The root cause is the same as DERBY-5607.
DriverManager.getConnection() used to be synchronized in Java 5/JDBC 3, and since the test
case runs the slave and the master in the same JVM, it runs into a deadlock when setting up
replication. That is, the startSlave command blocks in DriverManager.getConnection() until
the master has started, but the master cannot start because it can't get into DriverManager.getConnection()
as long as the slave hasn't completed its startup. This is not a problem in Java 6 or later,
as DriverManager.getConnection() is no longer synchronized.

I've attached a patch (3a) that makes the test use DataSource instead of DriverManager. This
avoids the problem on Java 5. It also makes it possible to run the test on JSR-169 platforms,
which don't have the DriverManager class.

Committed revision 1395482.
> File handle is leaked when a Slave replication is shutdown with failover=true
> -----------------------------------------------------------------------------
>                 Key: DERBY-5937
>                 URL: https://issues.apache.org/jira/browse/DERBY-5937
>             Project: Derby
>          Issue Type: Bug
>          Components: Replication
>    Affects Versions:
>         Environment: Windows 7
>            Reporter: Glenn McGregor
>            Assignee: Knut Anders Hatlen
>              Labels: derby_triage10_10
>             Fix For:
>         Attachments: d5937-1a-test.diff, d5937-2a-close.diff, d5937-3a-test-datasource.diff
> As part of our use of derby replication, we shut the slave down if we detect reachability
issues with the master. Normally we shut it down, and bring it back up as a regular database
in read-only mode.  Then when the master can, it tries to push a fresh copy back to the slave
system. However, during the failover=true shutdown on the slave, the log file  ".../name/log/log1.dat"
is still open. 
> Because of this open file, at least on Windows, it's impossible to move the database
file out of the way, and to install a fresh copy from the master.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message