[SNMP4J] System.exit() does not exit

Mark Gorokhov mark.gorokhov at comtechmobile.com
Thu May 1 20:58:58 CEST 2008


I have an option to remotely shutdown the application. This is simple:
valid SET request for a scalar triggers System.exit() call. Everything
was fine until I upgraded to v1.9.1d and Agent-1.2beta. The
System.exit() is called from RequestPool thread. The application
partially (!) closes, shutdown hook is called but all threads remain
active and JVM remains running.

I resolved the issue with 
EventQueue.invokeLater(new Runnable() {
  public void run() {
    System.exit(0);
  }
});

Where is the problem? Could you reproduce it? 

I inclined to blame new updates to ThreadPool.
BTW, there is a Sun tested ThreadPoolExecutor class since Java 1.5.

-mg




More information about the SNMP4J mailing list