[
http://issues.apache.org/jira/browse/DERBY-594?page=comments#action_12366045 ]
Knut Anders Hatlen commented on DERBY-594:
------------------------------------------
I haven't had time to work on this issue for a long time. Just thought
I'd summarize what I have found out till now in case someone is
interested.
TopService.bootModule() has a try/catch like this:
try {
BaseMonitor.boot(instance, create, properties);
} catch (StandardException se) {
moduleInstances.removeElement(module);
throw se;
}
If an exception is thrown in BaseMonitor.boot(), daemon threads might
have been started, but they are not shut down. This can be solved by
putting
TopService.stop(instance);
in the catch block.
However, this leads to two problems:
1) LogToFile.stop() gets a NullPointerException in
deleteObsoleteLogfiles() because currentCheckpoint is null. This
is easily solved by adding a test for currentCheckpoint == null
and not calling deleteObsoleteLogfiles() if that's the case.
2) If one tries to boot a database that is already booted in another
JVM, BaseMonitor.boot() will fail. However, the call to
TopService.stop() will delete the boot lock, even though it
belongs to another process. Therefore, trying once more to boot
the database will succeed. The solution to this problem is
probably to set a flag (e.g., ownerOfBootLock) when creating the
boot lock file, and to check the value of the flag before
deleting the file.
> Some rawStoreDaemon threads are not stopped
> -------------------------------------------
>
> Key: DERBY-594
> URL: http://issues.apache.org/jira/browse/DERBY-594
> Project: Derby
> Type: Bug
> Components: Services
> Versions: 10.1.2.0, 10.2.0.0
> Environment: Solaris 10 x86, NetBSD 2.1 (x86), Sun JDK 1.4.2/1.5.0
> Reporter: Knut Anders Hatlen
> Assignee: Knut Anders Hatlen
> Priority: Minor
>
> In some cases, loading a database will create a rawStoreDaemon thread
> which will run forever, even after Derby is shut down with
> DriverManager.getConnection("jdbc:derby:;shutdown=true").
> I have found two tests in derbyall (there are probably more) where
> threads are left running:
> - in store/rollForwardBackup.sql two threads are never terminated
> - in store/encryptDatabase.sql five threads are never terminated
> All the threads are named "derby.rawStoreDaemon" and created in
> org.apache.derby.impl.store.raw.RawStore.boot().
> It seems like this happens in some (but not all) cases where the
> loading of a database fails, but I am not able to say exactly what
> triggers this bug yet.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira