Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBIFfb691124 for ; Mon, 18 Dec 2000 10:41:37 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id eBIFflL19088 for ; Mon, 18 Dec 2000 10:41:47 -0500 (EST) To: pgsql-hackers@postgresql.org Subject: Re: Re: [SQL] PostgreSQL crashes on me :( In-reply-to: <20001217230141.A28714@store.zembu.com> References: <20001217215118.D64770@ilse.nl> <21339.977111275@sss.pgh.pa.us> <20001217230141.A28714@store.zembu.com> Comments: In-reply-to ncm@zembu.com (Nathan Myers) message dated "Sun, 17 Dec 2000 23:01:41 -0800" Date: Mon, 18 Dec 2000 10:41:47 -0500 Message-ID: <19085.977154107@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200012/767 X-Sequence-Number: 2288 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? BTW, we do block signals except at the select(), so the fear of random syscalls being interrupted by random other syscalls is overstated. regards, tom lane