For the archives…

On 17 Jun 2016, at 3:49 PM, Paul Hoadley <[email protected]> wrote:

> On 15 Jun 2016, at 2:56 PM, Paul Hoadley <[email protected]> wrote:
> 
>> 1. I assume that setting "refuse new sessions” on an instance in JavaMonitor 
>> will eventually send a SIGTERM to the app which will be caught by the 
>> graceful shutdown mechanism. (Hitting the stop button in Eclipse, for 
>> example, doesn’t do that and so gracefulTerminate() isn’t called. You have 
>> to simulate it by sending SIGTERM to the Java process from a terminal.) That 
>> is, will this even work in production? (I can’t imagine the answer here is 
>> no, but would be good to know if anyone’s doing/done it.)
> 
> As far as I can tell, this assumption was wrong, so we’re not off to a good 
> start. Hitting “refuse new sessions” for an instance (when it has no 
> sessions—haven’t completed testing on an instance that’s also waiting for 
> sessions to expire) eventually calls ERXApplication.refuseNewSessions(), 
> which calls terminate(), regardless of whether 
> er.extensions.ERXGracefulShutdown.Enabled is set true. The instance does do a 
> graceful shutdown if I send it a TERM signal from the console, but that’s not 
> really much help—I need this integrated with JavaMonitor.
> 
> Does anyone know what’s going on here? Was this feature just never hooked up 
> with JavaMonitor properly, or am I doing something wrong? Anyone using  
> GracefulApplication in any context?

You can certainly work around this by overriding both terminate() and 
gracefulTerminate():

        @Override
        public void gracefulTerminate() {
                // ...
                super.terminate();
        }

        @Override
        public void terminate() {
                gracefulTerminate();
        }

At that point, though, there doesn’t seem to be a point to implementing 
GracefulApplication and setting er.extensions.ERXGracefulShutdown.Enabled=true, 
as you may as well just override terminate(). The only thing 
GracefulApplication buys you is signal interception, which would seem to be 
pointless in the context of deploying with JavaMonitor. This feature seems to 
be half-cooked, then, or else I’m missing its intention. Unfortunately the 
original author is long gone.


-- 
Paul Hoadley
http://logicsquad.net/



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to