users@glassfish.java.net

Re: Restarting Glassfish

From: <glassfish_at_javadesktop.org>
Date: Sun, 23 Sep 2007 16:37:21 PDT

> 2) Trigger a restart in GF when settings are changed
> - what about GF
> creating a process at shutdown time, and having this
> process to launch
> another GF instance when the first one is gone, and
> then killing
> itself (I am not sure this can be done inside the
> same JVM)

Unfortunately this approach does not work easily. When you create a child process, it inherits all file descriptors from the parent and that would mean that newly created process would hold all ports and files from glassfish open. The process will then have enumerate through all file handles and close them one by one before trying to restart the glassfish process (to avoid running into "Port already in use" error). This can easily be done by going into OS native mode but if you compare the complexity with leaving a light weight parent shell running all the time, I think my pick will be obvious.

>
> - or even better -
>
> What about avoiding GF having to be restarted when
> some of the settings
> change? Do we really need to restart GF to change the
> port it is
> listening to for example or to change the classpath?
> I know that implementing things like that is not
> trivial, they add
> complexity without any real benefit, but I think they
> should be taken
> into account (maybe the next version?)
>

In general, that is the principle behind dynamic reconfiguration (change configuration without restarting) in glassfish. The intent is to make almost everything dynamically reconfigurable over time. If you have specific requirements on what would you like fixed first, please file an enhancement request.

There are some changes that can never be applied without restarting the VM (for example, changing VM memory settings, changing system classpath or changing system properties that affect loaded classes) but I think those changes are less frequent than changing configuration for http protocol.
[Message sent by forum member 'kumara' (kumara)]

http://forums.java.net/jive/thread.jspa?messageID=236687