From owner-freebsd-questions@FreeBSD.ORG Mon Apr 3 20:28:29 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 0911F16A422 for ; Mon, 3 Apr 2006 20:28:29 +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 8290643D48 for ; Mon, 3 Apr 2006 20:28:28 +0000 (GMT) (envelope-from kbottner@barkinglizards.com) Received: (qmail 10721 invoked from network); 3 Apr 2006 20:28:26 -0000 Received: from unknown (HELO Stile) (kbottner%barkinglizards.com@209.117.233.18) by pluto.phpwebhosting.com with SMTP; Mon, 03 Apr 2006 16:28:26 -0400 From: "Keith Bottner" To: Date: Mon, 3 Apr 2006 15:28:23 -0500 Organization: Barking Lizards Technologies Message-ID: <00b901c6575d$285768f0$0e01a8c0@Stile> MIME-Version: 1.0 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcZXXSboIM7qQVmCTKSUlwCfkwNnhg== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: SIGCHLD and sockets 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, 03 Apr 2006 20:28:29 -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