directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Karasulu (JIRA)" <directory-...@incubator.apache.org>
Subject [jira] Resolved: (DIREVE-151) Shutting down server multiple times results in 'Failed to sync all'
Date Tue, 29 Mar 2005 15:37:16 GMT
     [ http://issues.apache.org/jira/browse/DIREVE-151?page=history ]
     
Alex Karasulu resolved DIREVE-151:
----------------------------------

    Resolution: Won't Fix

David, a Shutdown hook is invoked only when you're shutting down the JVM.  The test code you
have here is not going to shutdown the JVM.  So you registered hooks will not run.  Looks
like you're using the facility incorrectly.  

I'm going to close this issue.  You have to revisit exactly what you're doing in product X.
 Plus don't worry about having to shut down the server on JVM exist.  The shutdown feature
is only there if you are shutting down without JVM exists.  Like in test cases which build
a database run tests, shut the server down, clean up and do this all over again without existing
the JVM.  The server registers its own hooks to make sure data is not lost from the cache
on the backend subsystem if there is a JVM exit.  You need not handle this manually.



> Shutting down server multiple times results in 'Failed to sync all'
> -------------------------------------------------------------------
>
>          Key: DIREVE-151
>          URL: http://issues.apache.org/jira/browse/DIREVE-151
>      Project: Directory Server
>         Type: Bug
>     Versions: 0.9
>  Environment: Windows XP, J2SE 1.4.2_05, Apache 0.9 SNAPSHOT
>     Reporter: David Geleyn
>     Assignee: Alex Karasulu
>      Fix For: 0.9
>  Attachments: Test.java, out.txt
>
> Situation in which the error occurs:
> When shutting down server of Product X (which embeds Apache Directory Server) we 
> have some problems with shutting down the embeded LDAP server. One of the 
> reasons could be the addShutdownhook in RootNexus.java. When embedding the 
> LDAP server we need to add a shutdownhook ourselves to make sure the LDAP 
> server is gracefully shutdown (see code below). Among other things, the 
> shutdown of the embedded LDAP server seems to call the sync on the 
> RootNexus as well, causing an IllegalStateException as 2 separate threads 
> are accessing the RootNexus.
> Java API for System.exit:
> The virtual machine's shutdown sequence consists of two phases. In the 
> first phase all registered shutdown hooks, if any, are started in some 
> unspecified order and allowed to run concurrently until they finish. 
> Example of shutting down (which is implicitly a part of our shutdownhook):
> Properties env = new Properties();
> env.setProperty(Context.PROVIDER_URL, "ou=system");
> env.setProperty(Context.INITIAL_CONTEXT_FACTORY, 
> "org.apache.ldap.server.jndi.ServerContextFactory");
> env.setProperty(Context.SECURITY_PRINCIPAL, "uid=admin,ou=system");
> env.setProperty(Context.SECURITY_CREDENTIALS, "secret");
> env.setProperty(EnvKeys.SYNC, "true");
> env.setProperty(EnvKeys.SHUTDOWN, "true");
> new InitialDirContext(env);
> Maybe this is caused by the soluttion for bug report 
> http://issues.apache.org/jira/browse/DIREVE-92?
> I'm capable of reproducing this behavior in a small program which is attached.
> The program will ask for input (via System.in.read). When asked for input, please press
Control-C to exit. The program will call the shutdown hook multiple times and will result
in a 'Failed to sync all'.

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message