|
From: Ole C. M. <ome...@sl...> - 2003-10-28 08:13:04
|
At 08:37 28.10.2003, Leif Mortenson wrote: >Ole, > >>When I read the docs this looked promising, but I have another >>requirement that I did not mention. I need to the restart action to work >>as well and I assume by using signalStopping I would not get the fresh >>server started until the previous stop action has completed satisfactory? > >True. The Wrapper does not allow a second JVM process to be launched >until the first >JVM process has been terminated one way or another. This is critical for most >applications to prevent conflicts with memory, ports and other resources. >It would also be quite a bit more difficult for the Wrapper to manage >multiple JVMs >at once. > >>>long periods of time after the JVM has been requested to exit is not the >>>norm. The >>>Wrapper supports it, but there are not many examples out there. >> >> Let me know if you have any questions. Allowing the JVM to run for >> relatively >> >>I understand, and I would not have implemented the server the way it is >>if I had a say, but it is a legacy app and hard to fix. The basic problem >>is that the server initializes it self with a lot of metadata from a >>database. It is not possible to reinitialize, one needs to restart the >>server. Since we use rmiregistry and stateful connections it is very easy >>to signal the running server to deregister and then register the new >>server. The previous server will then make sure to exit when all clients >>are logged off. Works smoothly. >> >>I'm not giving up just yet, so how will the wrapper like it if I change >>the script to do the following on the stop action: >> >>1. Execute my own command: >>java SignalDeRegister server-name >>2. Delete the pid file >> >>Will the subsequent start continue ok since the pid file is gone or will >>it contact ports to find an existing wrapper process? When the server >>decides it is time to close how can I signal the wrapper that the close >>is fine and there is no need to restart? System.exit(0)? > >This will not work because the pid file is for the Wrapper process and not >the JVM. >Deleting the PID will allow you to launch a separate copy of the Wrapper >which would >in turn in launch its own JVM. You will most likely run into problems >here as both >would be trying to access some of the same resources because they use the same >wrapper.conf file. That would be the port number? Your code seem to verify that the port is free and then increment, if not I can have the script increment it within a range The logfile can become muddled as well but I guess I can fix that by setting it to be something-timeofstart.log when invoking? If the JVM can make sure that the wrapper dies with it shouldn't be ok to have to wrapper running at the same time? I probably need to disable the automatic restarting, can I do that dynamically when I get the stop signal in my JVM? By using the signalStopping method? >What is preventing you from shutting down JVM instance 1 cleanly and then >restarting the >second JVM instance normally? Are you concerned about the period of time >where the >JVM is down? Key point is to not interrupt client applications by killing the existing server. The client app is about data access operations, building transactions and so on, so the current mode of operation is to notify the user that a fresh server is started but allow for them to complete what their doing and switch when it suits them. This then avoids us having to move the stateful connections from the old server to the new. Restarting is a fairly frequent thing as it is the only way to refresh all the metadata we have stored in a database. Like I mentioned before this is legacy app so this all works smoothly, and is also not something I can easily fix. I would have liked to take advantage of your cross platform scripts, nice config mechanism and the ability to protect the running server with your monitoring functionality, but alas.... >If you managed to get two JVMs running at the same time, you are going to >have lots of >timing issues trying to get them to switch over control. > >Sorry if I am missing what you are trying to do. Explain enough and I >will catch on >eventually. :-). I know I'm stretching the purpose a bit but I really like to adopt Wrapper for my app. Thanks for your help! olec >Cheers, >Leif > > > > >------------------------------------------------------- >This SF.net email is sponsored by: The SF.net Donation Program. >Do you like what SourceForge.net is doing for the Open >Source Community? Make a contribution, and help us add new >features and functionality. Click here: http://sourceforge.net/donate/ >_______________________________________________ >Wrapper-user mailing list >Wra...@li... >https://lists.sourceforge.net/lists/listinfo/wrapper-user ---- Ole Christian Meldahl Information Management Development - Stavanger Schlumberger Information Solutions mailto: ome...@sl... +47 5194 6736 |