Return-Path: Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 95261 invoked by uid 500); 22 Jun 2002 19:51:56 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 95240 invoked from network); 22 Jun 2002 19:51:55 -0000 Date: Sat, 22 Jun 2002 12:52:31 -0700 From: Brian Pane Subject: worker MPM shutdown To: dev@httpd.apache.org Cc: dev@apr.apache.org Message-id: <1024775552.10437.22.camel@localhost> MIME-version: 1.0 X-Mailer: Ximian Evolution 1.0.3 (1.0.3-4) Content-type: text/plain Content-transfer-encoding: 7BIT X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N During the worker MPM non-graceful shutdown, the signal_threads() function attempts to close all open sockets. I have two major objections to this: 1) It's not necessarily safe to close a socket that another thread is using. Note that apr_socket_close() calls the pool cleanup on the pool from which the socket was allocated--bad news if one of the active worker threads happens to be, say, registering a new cleanup in the same pool at the same time. 2) It appears to be contributing to the fact that non-graceful shutdown doesn't work. Without the socket shutdown loop, the child processes shut down promptly. As I understand it, the motivation for closing the sockets during shutdown was to try to fix a race condition in which an active worker thread might be trying to write to a socket at the same time that the underlying pool was being destroyed (due to the recursive destruction of APR's global_pool during apr_terminate()). If so, I think the right solution is to add a way to create parentless pools that aren't implicitly added as children to the global pool, so that a worker thread's pool won't disappear before that thread does. Is there any specific reason why we're not doing this already? Thanks, --Brian