Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: (qmail 63709 invoked from network); 13 Mar 2009 15:54:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Mar 2009 15:54:13 -0000 Received: (qmail 69124 invoked by uid 500); 13 Mar 2009 15:54:12 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 69100 invoked by uid 500); 13 Mar 2009 15:54:12 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 69089 invoked by uid 99); 13 Mar 2009 15:54:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Mar 2009 08:54:12 -0700 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [166.70.186.42] (HELO onyx.sharktooth.org) (166.70.186.42) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Mar 2009 15:54:03 +0000 Received: from [65.116.116.6] (helo=jade.overstock.com) by onyx.sharktooth.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1Li9hZ-000KwX-AC for modules-dev@httpd.apache.org; Fri, 13 Mar 2009 08:53:42 -0700 Message-ID: <49BA816E.80803@joe-lewis.com> Date: Fri, 13 Mar 2009 09:53:18 -0600 From: Joe Lewis User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: modules-dev@httpd.apache.org References: <6456355d0903130001q13165c19x4126c243546701d7@mail.gmail.com> <49BA78D5.9090503@joe-lewis.com> <6456355d0903130821w42cbf98co5b526b13f356cc4e@mail.gmail.com> <20170a030903130824ia40a958p842e2b053f8deaca@mail.gmail.com> In-Reply-To: <20170a030903130824ia40a958p842e2b053f8deaca@mail.gmail.com> Content-Type: multipart/alternative; boundary="------------090308030906040305080107" X-SA-Exim-Connect-IP: 65.116.116.6 X-SA-Exim-Mail-From: joe@joe-lewis.com X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on onyx.sharktooth.org X-Spam-Level: Subject: Re: post_config on reload X-SA-Exim-Version: 4.2 X-SA-Exim-Scanned: Yes (on onyx.sharktooth.org) X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED,HTML_MESSAGE autolearn=failed version=3.1.7 --------------090308030906040305080107 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sorin Manolache wrote: > On Fri, Mar 13, 2009 at 16:21, Andrej van der Zee > wrote: > >> Hi, >> >> Do not do this - a restart should be a restart, not a half of a restart. >> >>> You should be reinitializing whatever you do on a restart as well as a >>> start. That's the whole point. >>> >>> I have one phrase that should illustrate why : memory leak. >>> >>> For example, if your extension creates another thread or spawns another >>> process and that other thread/process doesn't clean up on a restart and >>> contains a memory leak, what good is restart to you? Restart has suddenly >>> become pointless. >>> >>> It is good etiquette to honour the concept of a restart. >>> >>> >> Okay, point taken. My extension indeed creates a thread. How can I know that >> a user issues a restart? In other words, where can I kill my thread? >> > > Register a function with the cleanup of the conf pool. The conf pool > is destroyed prior to a restart/kill/reload. > > You have an example in the code I've sent you. > > S > > Perfect answer! Unfortunately, the post_config is called twice on a restart, and with different memory pointers, so shared memory handles, mutexes, etc, those will all suddenly disappear. You'd be forced to initialize your post_config again or potentially segmentation fault the server. So, that is a good excuse to implement some extra code to handle restarting a thread anyway. Joe --------------090308030906040305080107--