From owner-freebsd-questions@FreeBSD.ORG Mon Apr 10 13:47:46 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A50AD16A400 for ; Mon, 10 Apr 2006 13:47:46 +0000 (UTC) (envelope-from kbottner@barkinglizards.com) Received: from pluto.phpwebhosting.com (pluto.phpwebhosting.com [69.0.209.128]) by mx1.FreeBSD.org (Postfix) with SMTP id 758CD43D48 for ; Mon, 10 Apr 2006 13:47:43 +0000 (GMT) (envelope-from kbottner@barkinglizards.com) Received: (qmail 24071 invoked from network); 10 Apr 2006 13:47:39 -0000 Received: from unknown (HELO Stile) (kbottner%barkinglizards.com@209.117.233.18) by pluto.phpwebhosting.com with SMTP; Mon, 10 Apr 2006 09:47:39 -0400 From: "Keith Bottner" To: Date: Mon, 10 Apr 2006 08:47:37 -0500 Organization: Barking Lizards Technologies Message-ID: <027201c65ca5$54c89ab0$0e01a8c0@Stile> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcZcpVHz7cGj/XbnR4KnRunb7QdsPg== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Subject: SIGCHLD and sockets HELP! X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2006 13:47:46 -0000 I am having a problem with SIGCHLD signals and their interaction with sockets. I have an application that forks modules in separate processes and use UNIX domain sockets for communication. The main application handles the SIGCHLD signal so that it can detect when/if a module crashes and if so restart that specific module. The problem arises when the module crashes and before the main application is notified with the SIGCHLD signal the socket will continue to allow writes. I expected that there would be occasions when the SIGCHLD signal would occur after my attempt to write into the socket, but I also expected the socket to return an error at which point I could then mark the module for restart as well. My question is, has anybody else had this problem? Does anybody know exactly what is going on an why? And most importantly, does anybody have a solution? Thanks in advance for your time, it is quite an interesting problem so I am hoping to get some insightful answers. Keith