The ill-named kill command simply sends a signal to a process: SIGHUP, SIGINT, SIGKILL… Some of those signals could be fatal, but mostly it’s the job of Progress’ C programmers to incorporate signal handling code in the OpenEdge executables. For the OpenEdge AVM, the common signal handlers are documented and, unless you’re running an old version, are fairly well behaved. SIGINT will cause the AVM to restart from its start-up program. SIGHUP will simulate a user hanging up his terminal session and gracefully end the AVM. SIGXCPU and SIGFPE are usually fatal and well behaved. Usually – be careful!
Two warnings:
The real danger comes from untrappable signals like SIGKILL (the famous “kill -9”) as the AVM is not given a chance to cleanup and exit gracefully. The process simply disappears and the watchdog process or broker is left to cleanup any mess. If that mess included holding a shared memory latch, the broker shuts down to ensure DB integrity. The lesson here is simple: JUST DON’T USE kill -s SIGKILL (kill -9).
The most common human error, besides using kill -9, is impatience. The DBA/sysadmin send a SIGHUP or SIGINT but nothing seems to happen. Worse, the process seems to be using CPU and doing disk IO so the DBA assumes that the process is ignoring him (and nobody likes to be ignored). The DBA repeats the kill command, or uses a different kill signal, escalating and eventually causing a database crash. Don’t do this. In reality, the process was likely undoing the work that was interrupted by the first signal, and, after it finishes its cleanup, will exit gracefully.
Instead follow these steps:
Paul Koufalis first wrote killprosession almost 20 years ago. He was working at a customer with around 1500 concurrent shared memory users and the need to terminate shared memory processes was an almost daily occurrence, eating up a considerable amount of the local DBA’s time. With killprosession, when a long-running open transaction was detected, or if an important business process was blocked , an alert was generated and sent to the help desk, not the DBA! The help desk would follow a preset script: a) contact the user; b) remote desktop into their PC; c) killprosession. If the problem persisted or the situation deviated from their script, it was then escalated to the DBA. Killprosession tells you exactly what the process is doing (or not doing), helping you make an informed decision about what to do next. It’s included with the free ProTop download.
No matter the situation, your first responsibility is to protect the database. It does happen occasionally that an OpenEdge client process just won’t die, and you may need to plan a shutdown to safely get rid of it. Be patient, avoid untrappable signals, use killprosession to automate the process and please don’t hesitate to reach out to one of the experts at WSS if you have any questions.