ExecutionManager shutdown not killing process

I am running the function below executionManager.executeOnce(server::spawnExe):

public void spawnExe() {
    CommandLine cmdLine = CommandLine.parse(installedServerPath);

    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    PumpStreamHandler streamHandler = new PumpStreamHandler(outputStream);

    DefaultExecutor executor = new DefaultExecutor();

    executor.setStreamHandler(streamHandler);
    int exitCode = 0;
    try {
        exitCode = executor.execute(cmdLine);
        logger.info("server is dying now");
        logger.info("server is dying now");
        logger.info("server is dying now");
        logger.info("server is dying now");
        logger.info("server is dying now");
        logger.info(String.format("exit code, %d", exitCode));

    } catch (IOException e) {
        logger.error(e.getStackTrace().toString());
    }

}

So the function is hanging during execution which is fine for me, but when i run the following during “public void shutdown()”:

executionManager.unRegisterAll(“myModule”);
executionManager.shutdown();

The exe doesnt stop running…

BasicExecutionEngine just attempts to call ExecutorService.shutdownNow(), which per the Javadoc has no guarantee of actually stopping execution:
https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ExecutorService.html#shutdownNow()

If you’re calling out to a native process, you’ll need to guarantee its shutdown via some other mechanism.

Ok, got it. Thanks for clarifying