Re: HELP! runaway sqlexec
Posted in 1993
> > > > In case misery loves company, I have encountered this also. Not that I > > can help you much. > > > > Circumstances for our occurrence: > > 1. User uses NCSA telnet on a Mac to login to our Sun server. > > 2. User runs our Informix application. > > 3. User closes the Mac window without exiting from Informix application. > > 4. Perfmeter hits redline. > > > What causes this? My guess is the sqlexec is running around frantically > > saying the electronic equivalent of "Yoo hoo! Where are you?" > > > > Is there any way to prevent it? > > 1. Educate your users. (Sort of) easy; short term pay-back; middling > > success, based on user cooperation level. > > > > 2. Ask Informix to make sqlexec trap for lost connection. I'm not sure how > > (or if) it can be done, and it's probably pretty hard; so, unless *lots* > > of folks ask for this, Informix probably won't do it. Pay-back would be > > way down stream. If Informix makes the change, then high success. > > > > We have the same phenomenon. On our machine the sqlexec's get reparented > to process 1 (since the real parent was killed when the line drops). So, > we have a daemon that periodically looks for sqlexec processes with parent > of 1 (which should never legitimately happen) and squashes any that are > found. Crude, but effective. > Crude and very unhealthy I would have thought. Why not hook in a C function, `on begin' in a form, or called from main in 4gl or esql/c or whatever is appropriate which installs a catcher for SIGHUP which in turn does an sqlexit()? On second thoughts, shouldn't informix do this for you? Anyway: #include <signal.h> void (*signal())(); void catcher(); void (*oldfunc)(); void init_catcher() /* called at startup - change i/f as appropriate */ { oldfunc = signal(SIGHUP, catcher); } void catcher() { sqlexit(); if (oldfunc) (*oldfunc)(); } That's completely untested but might be worth a try. If someone flames me with ``NEVER NEVER NEVER do THAT!'' then apologies in advance. =========================================================================== | Bill Hails <bill@tardis.co.uk> | | | C.L.I. Connect Ltd. | README: permission denied | | 19, Quarry St., Guildford, Surrey | | | GU1 3UY. Tel (UK) 0483 300 200 | | ===========================================================================