Mindoo Blog - Cutting edge technologies - About Java, Lotus Notes and iPhone

  • Domino crashes with "CheckTheProcesses" message - explanation and workaround for dev environments

    Karsten Lehmann  13 July 2022 10:10:42
    Since Domino 8.5.3, there is a built-in facility that checks if all server processes are running. When the server detects that one has disappeared/crashed, the server triggers an NSD to document this event and crashes/restarts.

    In general, this is a clean approach to keep the server in a consistent state.

    But when you develop Java applications against the Domino Server's Java API, those Java processes are treated as child processes and monitored as well
    It's important to develop the applications in a clean way, so every Thread accessing Domino objects should be initialized with NotesThread.sinitThread() and properly uninitialized with NotesThread.stermThread().

    To ensure that this is also the case when errors occur in code, use try/finally:

    NotesThread.sinitThread();
    Session session = null;
    try {
       session = NotesFactory.createSession();
       // do something with the session object
    }
    catch (NotesException e) {
       e.printStackTrace();
    }
    finally {
       if (session!=null) {
          try { session.recycle(); } catch (NotesException e) {e.printStackTrace();}
       }
       NotesThread.stermThread();
    }

    This works in general, but often during development, you step through the code in debugger and just stop its execution, which produces this annoying result:

    Image:Domino crashes with "CheckTheProcesses" message - explanation and workaround for dev environments

    Fortunately it is possible disable the automatic Domino crash/restart with this Notes.ini variable:

    NO_TERM_EXIT_NO_PANIC=1

    The server still complains about the missing child process, but keeps on running.

    Of course, it would be even better if there was a way to exclude specific processes/process names from the monitoring.

    Comments

    1Daniel Nashed  13.07.2022 17:13:15  Domino crashes with CheckTheProcesses message - explanation and workaround for dev environments

    If the code runs ANY Domino code, you better let it crash and recover.

    If this is just Java without and Domino resources allocated, that might be a valid approach for a test environment. But only in that case.

    The crash monitor has been introduced in Windows, because there is no signal child died on Windows like on Linux. And all applications not terminating properly, cause a panic.

    The process monitor should only hit processed, which are notes initialized.

    So it sounds like Java falls under that category.

    You can end up with not cleaned up share memory, locked semaphores etc.

    So I would personally not run that parameter anywhere...

    2Daniel Nashed  13.07.2022 17:13:15  Domino crashes with CheckTheProcesses message - explanation and workaround for dev environments

    If the code runs ANY Domino code, you better let it crash and recover.

    If this is just Java without and Domino resources allocated, that might be a valid approach for a test environment. But only in that case.

    The crash monitor has been introduced in Windows, because there is no signal child died on Windows like on Linux. And all applications not terminating properly, cause a panic.

    The process monitor should only hit processed, which are notes initialized.

    So it sounds like Java falls under that category.

    You can end up with not cleaned up share memory, locked semaphores etc.

    So I would personally not run that parameter anywhere...

    3Karsten Lehmann  13.07.2022 20:08:26  Domino crashes with CheckTheProcesses message - explanation and workaround for dev environments

    I would only use this setting on dev machines.

    And there, when a Java process that uses Domino objects is stopped while it is accessing Domino, I would expect that some resource leaks may appear, in rare cases also hanging semaphores.

    So of course this may produce issues, but in some cases it saves time.

    BTW HCL has a support document in Japanese that recommends setting this variable on some servers that are running HCL Enterprise Integrator.

    https://support.hcltechsw.com/csm?id=kb_article&sysparm_article=KB0079927

    4Karsten Lehmann  13.07.2022 20:17:58  Domino crashes with CheckTheProcesses message - explanation and workaround for dev environments

    BTW in most cases we are developing Java applications against the Notes Client Java/C API.

    There it is usual to stop code execution during development. Should be no different to a local Domino server with this switch.

    5SJfMRhibdYILsjT    RqfOMTUXvpYxjdlQ