Re: process hangs in sqlexit
Posted in 1996
Hi,
> I have the following esqlc code being executed at exit time:
> sqlbreak();
> $ close database;
> if (sqlca.sqlcode)
> {
> InformixErrMsg(sqlca.sqlcode, "Error closing database rfpos\\n",
> sqlca.sqlcode);
> }
> sqlexit();>
> My process hangs and the traceback I get is as follows:
> (dbx) where
> [1] _wait(0xeffff474, 0x0, 0x60b0c, 0x60b48, 0x60b3c, 0x0), at
> 0xef72bde4
> [2] killbackend(0x5c1e8, 0xd, 0xeffff520, 0x60b48, 0x60b3c,
> 0xef773720), at 0x
> 40880
> [3] sqlexit(0x5e008, 0x41, 0xeffff580, 0x3074ab58, 0x2, 0xef773720),
> at 0x3205
> c
> [4] CloseDB(0x5b4cc, 0x5068, 0x5b4f0, 0x76, 0x5fbc0, 0x1), at 0x24abc
> =>[5] Terminate(sig = 1), line 121 in "main.c"
> [6] main(argc = 4, argv = 0xeffff684), line 454 in "main.c"
>
> I'm sorry, I only have 4.0 esqlc docs and am running 5.04uc1. Perhaps,
> Im not doing this right or at the right time.
I had similar problems.
I had opened a connection to the backend ($database ...), then opened a
pipe for write using popen. The child process inherited the open connection
to the backend, so the sqlexit wouldn't work from the parent, cos the
child still was connected to the backend.
The backend tried to read from the frontend, but blocks trying to read
from the child, so doesn't die...
So I had to either '$close database' before any fork, popen or whatever,
or, as I did, recode popen to only keep the files I was interested in.
Good luck,
Andy.
--
=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=
Andy Lennard andy@kontron.demon.co.uk
Kontron Instruments Ltd,
Blackmoor Lane, Phone: +44 1923 245991
Croxley Centre, Fax: +44 1923 412211
Watford,
Herts, UK. WD1 8XQ
=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=-~-=