Re: more about kill -9, tbmode -z ...
Posted in 1994
In article <2nsng6$5vs@emory.mathcs.emory.edu> ccmp@dec1.tvp.com.pl (Michal Pegierski) writes: >1. How tbmode -z pid acts ?; make a kill call (with what SIG), or > communicates through shared memory ?; because server proccess It sends SIGUSR1 (16) to the sqlturbo process. >The questions are: > and application process communicates through pipe could it be SIGPIPE ? (Informix, correct me if I'm wrong...) sqlexec/sqlturbo will get SIGPIPE from the OS if it writes to a closed pipe. This would happen if you killed the application while the engine was busy performing something like a select statement. When the engine then attempts to send the results back to the application by writing to the pipe it will get SIGPIPE. The engine traps that signal and will die gracefully (ie rollback any open transactions). This suggests that kill -13 is a reasonably safe way to kill sqlexec/sqlturbo. If on the other hand the engine was idle and waiting for a command from the application when the application is killed then it will read EOF from the pipe. Again this will cause a rollback after which the engine will exit. >2. How to kill safetly application process killing at the same time database > server (from keyboard Ctrl-C or interrupt can do it) ? This is my preferred recipe: First kill the application. Then send a SIGTERM (15) to the engine to interrupt whatever it was doing. It will then attempt to read from the pipe which is now closed, get an EOF, and start a rollback. Let it finish the rollback, don't use kill -9 or anything like that. The engine will exit when the rollback is finished. -- Hugh Grierson hugh@fujitsu.co.nz 22C, mostly sunny