Avoiding defunct EAC processes

On UNIX systems, the ps command may report a number of defunct EAC-originated processes. This is known and expected EAC behavior and it does not necessarily indicate a problem.

For example, you might see the following output from the ps command:
> ps -ef | grep endeca
endeca 1924 1875 0 - ? 2:00 <defunct>
[...]
Additionally, warning messages of this form appear in the $ENDECA_CONF/logs/process.0.log file on the affected server:
Apr 17, 2009 11:24:17 AM
com.endeca.esf.delegate.procctrl.ExecutableProcessHandle
tryCleanShutdown
WARNING: Process 1924 did not shutdown cleanly after 30 seconds.
Terminating forcefully.

The cause of these warning messages is as follows. When the EAC shuts down a child process like a Dgraph, it initially sends the correct exit command for the process (admin?op=exit in the case of the Dgraph) and waits 30 seconds for the process to exit. However, if the Dgraph is processing a long-running query, or if its request queue is long, it may not be able to shut down within 30 seconds.

If the process does not exit after 30 seconds, the EAC logs the warning message shown above and then kills the process with the operating system's kill command. When this occurs, the affected process is reported by ps as being in a <defunct> state. In this state, it does not use memory, disk space, or ports and should not be a problem for the system.

Alternatively, this can happen if you kill the EAC process directly rather than by using the shutdown.sh script. In this case the EAC process terminates immediately, leaving any chlid processes in a <defunct> state.

To avoid defunct EAC processing, consider the following recommendations: