Received: from foghorn.airs.com (foghorn.airs.com [63.201.54.26]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id eBIHvw603962 for ; Mon, 18 Dec 2000 12:57:58 -0500 (EST) (envelope-from ian@airs.com) Received: (qmail 16715 invoked by uid 10); 18 Dec 2000 17:58:07 -0000 Received: (qmail 29751 invoked by uid 269); 18 Dec 2000 17:58:02 -0000 Message-ID: <20001218175802.29750.qmail@daffy.airs.com> Mail-Followup-To: pgsql-hackers@postgresql.org, tgl@sss.pgh.pa.us Date: 18 Dec 2000 09:58:02 -0800 From: Ian Lance Taylor To: tgl@sss.pgh.pa.us CC: pgsql-hackers@postgresql.org In-reply-to: <19085.977154107@sss.pgh.pa.us> (message from Tom Lane on Mon, 18 Dec 2000 10:41:47 -0500) Subject: Re: Re: [SQL] PostgreSQL crashes on me :( References: <20001217215118.D64770@ilse.nl> <21339.977111275@sss.pgh.pa.us> <20001217230141.A28714@store.zembu.com> <19085.977154107@sss.pgh.pa.us> X-Archive-Number: 200012/771 X-Sequence-Number: 2292 Date: Mon, 18 Dec 2000 10:41:47 -0500 From: Tom Lane ncm@zembu.com (Nathan Myers) writes: > Sounds like a TODO list item: eliminate syscalls from signal handlers. After looking at it some more, I think that's a lot easier said than done. We could try writing the postmaster's SIGCHLD routine in the same style currently used for SIGHUP --- ie, signal handler just sets a flag that's examined by the main loop in ServerLoop --- but I don't see any way to guarantee timely response if we do that. If the SIGCHLD happens just before we reach the select() then the select() will block, and we won't respond to the dying child until the next connection request arrives or some other signal happens. That's OK under normal scenarios, but highly not OK when a backend has crashed. Any thoughts on a cleaner solution? One way to avoid this race condition is to set a timeout on the select. What is the maximum acceptable time for a timely response? Would executing a few instructions at that time interval impose an unacceptable system load? (Naturally no timeout should be used if there are no child processes.) Ian