Menu

#2530 disable System.exit for web applications and use in Python

nextrelease
open-fixed
nobody
None
5
2023-07-20
2023-07-18
No

In Python's jpype, calling System.exit will also shut down the Python environment. Also, calling system.exit in a web container will shut down the container. I've added a switch to disable the call to System.exit in AppManager to avoid this in Python. (Note that you should never have to explicitly call System.exit, and I should remind myself why this is needed in Autoplot.)

The web container, which can run whitelisted scripts, still has the problem that if System.exit is called the web container is shut down. A more complete solution would add a hook to the shutdown sequence.

Discussion

  • Jeremy Faden

    Jeremy Faden - 2023-07-18

    See https://github.com/jpype-project/jpype/issues/961, the ticket in JPype where someone wants to change the shutdown behavior.

     
  • Jeremy Faden

    Jeremy Faden - 2023-07-20
    • status: open --> open-fixed
     
  • Jeremy Faden

    Jeremy Faden - 2023-07-20

    This is done, see AppManager.getInstance().setAllowExit(false).

     
MongoDB Logo MongoDB