Good morning,

Has anybody updated Wonder’s ERXSignalHandler so that it doesn’t rely on 
sun.misc.*?

It seems to be used by ERXEC’s registerOpenEditingContextLockSignalHandler() 
which registers for “HUP”. 

Also sun.misc.SignalHandler is extended by ERXGracefulShutdown. 

In the cloud world environment, e.g.  AWS/EKS/EC2, an app almost never needs 
SIGHUP anymore. 

Kubernetes EKS does not use HUP
It uses SIGTERM first to request a graceful shutdown. Then after a grace 
period, SIGKILL if the process does not exit. 

EC2 (systemd) also avoids HUP

Systemd service units use SIGTERM for graceful stop. 

A WebObjects app on EKS or EC2 should not expect or need HUP. 

JVM Shutdown Hooks

Java allows you to register clean up code that executes when JVM begins 
shutdown. 

Runtime.getRuntime().addShutdownHook(new Thread(() -> { … }));

They will execute when SIGTERM (graceful termination) is requested. SIGINT when 
process receives ctrl+C. 

They will not execute if SIGKILL is received (kill -9) or when JVM crashes due 
to fatal signals (SIGSEGV, etc.)

Anyways, it seems it could be updated to used java’s shutdown hooks and play 
better in modern Java and cloud world. 

Has anybody updated wonder to migrate away from sun.misc?

Thank you
Ricardo Parada


Reply via email to