Re: "defunct" processes in Solaris
Posted in 1998
Irina Kotlova wrote: > > Hello! > I use Informix OnLine 5.0 under Solaris 2.5.1. My application works each > day from the morning to the evening and each 5 seconds reads new > records, appeared in DB (written there by another application). I use > Dirty Read Isolation Level. As I've understood, sometimes I obtain a > number of "defunct" processes born by my application. The number of > "defunct" processes may increase greatly and even stop DB. Don't you > know what's the reason of such a behavior and how I can avoid it? Does > that mean that I must start another process under Solaris that could > keep trace about all "defunct" processes, having arisen from my > application, and kill them? Is there any more pleasant way within the > same application? Are you forking and/or execing from that application? Then the defuncts are your apps children which have exited and their process table record is hanging around waiting for you to call the wait() system call and read it's exit status. You either have to program a SIGCHLD handler to do that or call signal(SIGCHLD, SIG_IGN). You cannot have a process killing the defuncts, they are already dead on a BSD system these would become zombies when your app exits, under SYS V like Solaris when you exit the init process cleans them up for you but your app does not exit so... > 2. I read new records from DB view each 5 seconds, analyzing the column = > with record time creation value. Sometimes I may lose a record. For = > example, if I fetch all rows, created between 16:00:08 and 16:00:12 at = > the time moment 16:00:13, I lose sometimes a row with value "16:00:12" = > in the column. How can I escape from this situation? Will committed Read = > Isolation help me or not? It might be better to have the process that is inserting/updating records insert into a log table the rowid or key of the rows it processed then your background task can delete the log records after it processes each new row. Art S. Kagel