<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-183</id>
	<title>Nabble - mod_perl</title>
	<updated>2009-12-14T14:58:14Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/mod_perl-f183.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/mod_perl-f183.html" />
	<subtitle type="html">mod_perl is the marriage of Apache and Perl. mod_perl home is &lt;a href=&quot;http://perl.apache.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.</subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26786520</id>
	<title>Re: [Fwd: Re: Apache::DBI]</title>
	<published>2009-12-14T14:58:14Z</published>
	<updated>2009-12-14T14:58:14Z</updated>
	<author>
		<name>Adam Prime</name>
	</author>
	<content type="html">&lt;br&gt;It applies cleanly to a fresh checkout for me. &amp;nbsp;I've attached another,
&lt;br&gt;freshly generated (and identical) patch.
&lt;br&gt;&lt;br&gt;$ patch -p0 &amp;lt; ~/dbi.patch
&lt;br&gt;patching file lib/Apache/DBI.pm
&lt;br&gt;$
&lt;br&gt;&lt;br&gt;Adam
&lt;br&gt;&lt;br&gt;Fred Moyer wrote:
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Mon, Dec 14, 2009 at 1:22 PM, Adam Prime &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786520&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;adam.prime@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt; This thread is 6 months stale, but Jonathan Swartz just replied to the
&lt;br&gt;&amp;gt;&amp;gt; RT ticket, and once again brought it to mind.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Can we please do something about this, even if that something is
&lt;br&gt;&amp;gt;&amp;gt; re-releasing Apache::DBI 1.06 as 1.08 (as pgollucci said he was going to
&lt;br&gt;&amp;gt;&amp;gt; do over a year and a half ago).
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; First thing we will need is a patch that doesn't fail when applied - [1].
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I may be able to clean it up this week and run the test suite against it.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; [1]
&lt;br&gt;&amp;gt; svn phred@pooky ~/dev/svn/modperl/Apache-DBI/trunk $ svn update
&lt;br&gt;&amp;gt; At revision 890520.
&lt;br&gt;&amp;gt; phred@pooky ~/dev/svn/modperl/Apache-DBI/trunk $ patch -p0 &amp;lt; p.patch
&lt;br&gt;&amp;gt; patching file lib/Apache/DBI.pm
&lt;br&gt;&amp;gt; Hunk #1 succeeded at 39 with fuzz 2.
&lt;br&gt;&amp;gt; Hunk #2 FAILED at 124.
&lt;br&gt;&amp;gt; Hunk #3 FAILED at 136.
&lt;br&gt;&amp;gt; Hunk #4 FAILED at 222.
&lt;br&gt;&amp;gt; Hunk #5 succeeded at 236 with fuzz 1.
&lt;br&gt;&amp;gt; 3 out of 5 hunks FAILED -- saving rejects to file lib/Apache/DBI.pm.rej
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Adam
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; -------- Original Message --------
&lt;br&gt;&amp;gt;&amp;gt; Subject: Re: Apache::DBI
&lt;br&gt;&amp;gt;&amp;gt; Date: Mon, 27 Jul 2009 00:06:07 -0400
&lt;br&gt;&amp;gt;&amp;gt; From: Adam Prime &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786520&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;adam.prime@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; To: Fred Moyer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786520&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;fred@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; CC: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786520&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev@...&lt;/a&gt;
&lt;br&gt;&amp;gt;&amp;gt; References: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786520&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;4A65C9A1.70602@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786520&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;4A65EC64.4060804@...&lt;/a&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786520&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;4A65FE8E.1020205@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786520&amp;i=7&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;4A6610A1.7020900@...&lt;/a&gt;&amp;gt; &amp;nbsp; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786520&amp;i=8&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;4A6689E0.2030401@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786520&amp;i=9&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ad28918e0907220152o6cfe5272r5280d8b19f1f6161@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786520&amp;i=10&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;4A6708EE.7030104@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Adam Prime wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Fred Moyer wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; On Tue, Jul 21, 2009 at 8:39 PM, Adam Prime&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786520&amp;i=11&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;adam.prime@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Adam Prime wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; What I wanted to do was fix this issue:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://rt.cpan.org/Public/Bug/Display.html?id=36346&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rt.cpan.org/Public/Bug/Display.html?id=36346&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I was just looking over your original code where you connect() in
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; startup.pl. &amp;nbsp;Won't that cause issues since the database handle will be
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; forked also? &amp;nbsp;Here's what I have in my startup.pl:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; The code in the ticket was just to illustrate the failure. &amp;nbsp;I ran into
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; this problem because I wanted to preload a large read-only datastructure
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; out of the database prior to the fork to get it completely shared
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; between all the children. &amp;nbsp;The handle itself is then disconnected and
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; discarded.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Adam
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; The patch attached ads code to bail out of connect() calls called prior
&lt;br&gt;&amp;gt;&amp;gt; to the fork by setting a package global during the ChildInit phase,
&lt;br&gt;&amp;gt;&amp;gt; along with the other patch which was submitted to the users mailing list.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; It works fine for me in extremely limited testing.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Thoughts?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Adam
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Index: lib/Apache/DBI.pm
&lt;br&gt;&amp;gt;&amp;gt; ===================================================================
&lt;br&gt;&amp;gt;&amp;gt; --- lib/Apache/DBI.pm &amp;nbsp; (revision 796605)
&lt;br&gt;&amp;gt;&amp;gt; +++ lib/Apache/DBI.pm &amp;nbsp; (working copy)
&lt;br&gt;&amp;gt;&amp;gt; @@ -39,6 +39,9 @@
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # &amp;nbsp; a negative value de-activates ping,
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # &amp;nbsp; default = 0
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;my %LastPingTime; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # keeps track of last ping per data_source
&lt;br&gt;&amp;gt;&amp;gt; +my $ChildExitHandlerInstalled; &amp;nbsp;# set to true on installation of
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# PerlChildExitHandler
&lt;br&gt;&amp;gt;&amp;gt; +my $InChild;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;# Check to see if we need to reset TaintIn and TaintOut
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;my $TaintInOut = ($DBI::VERSION &amp;gt;= 1.31) ? 1 : 0;
&lt;br&gt;&amp;gt;&amp;gt; @@ -121,8 +124,7 @@
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; # unpredictable query results.
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; # See: &lt;a href=&quot;http://perl.apache.org/docs/2.0/user/porting/compat.html#C__Apache__Server__Starting__and_C__Apache__Server__ReStarting_&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://perl.apache.org/docs/2.0/user/porting/compat.html#C__Apache__Server__Starting__and_C__Apache__Server__ReStarting_&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; if (MP2) {
&lt;br&gt;&amp;gt;&amp;gt; - &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;require Apache2::ServerUtil;
&lt;br&gt;&amp;gt;&amp;gt; - &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (Apache2::ServerUtil::restart_count() == 1) {
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (!$InChild) {
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; debug(2, &amp;quot;$prefix skipping connection during server startup, read the docu !!&amp;quot;);
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return $drh-&amp;gt;connect(@args);
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt;&amp;gt; @@ -134,6 +136,23 @@
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp;# this PerlChildExitHandler is supposed to disconnect all open
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp;# connections to the database
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp;if (!$ChildExitHandlerInstalled) {
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$ChildExitHandlerInstalled = 1;
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;my $s;
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (MP2) {
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$s = Apache2::ServerUtil-&amp;gt;server;
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;elsif (Apache-&amp;gt;can('push_handlers')) {
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$s = 'Apache';
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ($s) {
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;debug(2, &amp;quot;$prefix push PerlChildExitHandler&amp;quot;);
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$s-&amp;gt;push_handlers(PerlChildExitHandler =&amp;gt; \&amp;childexit);
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt;&amp;gt; +
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; # this PerlCleanupHandler is supposed to initiate a rollback after the
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; # script has finished if AutoCommit is off. &amp;nbsp;however, cleanup can only
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; # be determined at end of handle life as begin_work may have been called
&lt;br&gt;&amp;gt;&amp;gt; @@ -203,6 +222,7 @@
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; my $prefix = &amp;quot;$$ Apache::DBI &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; debug(2, &amp;quot;$prefix PerlChildInitHandler&amp;quot;);
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp;$InChild = 1;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; %Connected = () if MP2;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; if (@ChildConnect) {
&lt;br&gt;&amp;gt;&amp;gt; @@ -216,6 +236,22 @@
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 1;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;}
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; +# The PerlChildExitHandler disconnects all open connections
&lt;br&gt;&amp;gt;&amp;gt; +sub childexit {
&lt;br&gt;&amp;gt;&amp;gt; +
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp;my $prefix = &amp;quot;$$ Apache::DBI &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;;
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp;debug(2, &amp;quot;$prefix PerlChildExitHandler&amp;quot;);
&lt;br&gt;&amp;gt;&amp;gt; +
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp;foreach my $dbh (values(%Connected)) {
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;eval { DBI::db::disconnect($dbh) };
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ($@) {
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;debug(2, &amp;quot;$prefix DBI::db::disconnect failed - $@&amp;quot;);
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt;&amp;gt; +
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp;1;
&lt;br&gt;&amp;gt;&amp;gt; +}
&lt;br&gt;&amp;gt;&amp;gt; +
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;# The PerlCleanupHandler is supposed to initiate a rollback after the script
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;# has finished if AutoCommit is off.
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;# Note: the PerlCleanupHandler runs after the response has been sent to
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; ---------------------------------------------------------------------
&lt;br&gt;&amp;gt;&amp;gt; To unsubscribe, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786520&amp;i=12&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;&amp;gt;&amp;gt; For additional commands, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786520&amp;i=13&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; ---------------------------------------------------------------------
&lt;br&gt;&amp;gt; To unsubscribe, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786520&amp;i=14&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;&amp;gt; For additional commands, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786520&amp;i=15&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;Index: lib/Apache/DBI.pm
&lt;br&gt;===================================================================
&lt;br&gt;--- lib/Apache/DBI.pm	(revision 890524)
&lt;br&gt;+++ lib/Apache/DBI.pm	(working copy)
&lt;br&gt;@@ -39,6 +39,9 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# &amp;nbsp; a negative value de-activates ping,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# &amp;nbsp; default = 0
&lt;br&gt;&amp;nbsp;my %LastPingTime; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # keeps track of last ping per data_source
&lt;br&gt;+my $ChildExitHandlerInstalled; &amp;nbsp;# set to true on installation of
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# PerlChildExitHandler
&lt;br&gt;+my $InChild;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;# Check to see if we need to reset TaintIn and TaintOut
&lt;br&gt;&amp;nbsp;my $TaintInOut = ($DBI::VERSION &amp;gt;= 1.31) ? 1 : 0;
&lt;br&gt;@@ -121,8 +124,7 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;# unpredictable query results.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;# See: &lt;a href=&quot;http://perl.apache.org/docs/2.0/user/porting/compat.html#C__Apache__Server__Starting__and_C__Apache__Server__ReStarting_&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://perl.apache.org/docs/2.0/user/porting/compat.html#C__Apache__Server__Starting__and_C__Apache__Server__ReStarting_&lt;/a&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if (MP2) {
&lt;br&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;require Apache2::ServerUtil;
&lt;br&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (Apache2::ServerUtil::restart_count() == 1) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (!$InChild) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;debug(2, &amp;quot;$prefix skipping connection during server startup, read the docu !!&amp;quot;);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return $drh-&amp;gt;connect(@args);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;@@ -134,6 +136,23 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;# this PerlChildExitHandler is supposed to disconnect all open
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;# connections to the database
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;if (!$ChildExitHandlerInstalled) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$ChildExitHandlerInstalled = 1;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;my $s;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (MP2) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$s = Apache2::ServerUtil-&amp;gt;server;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;elsif (Apache-&amp;gt;can('push_handlers')) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$s = 'Apache';
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ($s) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;debug(2, &amp;quot;$prefix push PerlChildExitHandler&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$s-&amp;gt;push_handlers(PerlChildExitHandler =&amp;gt; \&amp;childexit);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;# this PerlCleanupHandler is supposed to initiate a rollback after the
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;# script has finished if AutoCommit is off. &amp;nbsp;however, cleanup can only
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;# be determined at end of handle life as begin_work may have been called
&lt;br&gt;@@ -203,6 +222,7 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;my $prefix = &amp;quot;$$ Apache::DBI &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;debug(2, &amp;quot;$prefix PerlChildInitHandler&amp;quot;);
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;$InChild = 1;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;%Connected = () if MP2;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if (@ChildConnect) {
&lt;br&gt;@@ -216,6 +236,22 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;1;
&lt;br&gt;&amp;nbsp;}
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+# The PerlChildExitHandler disconnects all open connections
&lt;br&gt;+sub childexit {
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;my $prefix = &amp;quot;$$ Apache::DBI &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;debug(2, &amp;quot;$prefix PerlChildExitHandler&amp;quot;);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;foreach my $dbh (values(%Connected)) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;eval { DBI::db::disconnect($dbh) };
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ($@) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;debug(2, &amp;quot;$prefix DBI::db::disconnect failed - $@&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;1;
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;# The PerlCleanupHandler is supposed to initiate a rollback after the script
&lt;br&gt;&amp;nbsp;# has finished if AutoCommit is off.
&lt;br&gt;&amp;nbsp;# Note: the PerlCleanupHandler runs after the response has been sent to
&lt;br&gt;&lt;br&gt;&lt;br /&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786520&amp;i=16&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786520&amp;i=17&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---Dev-f187.html&quot; embed=&quot;fixTarget[187]&quot; target=&quot;_top&quot; &gt;mod_perl - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-Fwd%3A-Re%3A-Apache%3A%3ADBI--tp26785119p26786520.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26786355</id>
	<title>Re: [Fwd: Re: Apache::DBI]</title>
	<published>2009-12-14T14:44:49Z</published>
	<updated>2009-12-14T14:44:49Z</updated>
	<author>
		<name>Fred Moyer</name>
	</author>
	<content type="html">On Mon, Dec 14, 2009 at 1:22 PM, Adam Prime &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786355&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;adam.prime@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; This thread is 6 months stale, but Jonathan Swartz just replied to the
&lt;br&gt;&amp;gt; RT ticket, and once again brought it to mind.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Can we please do something about this, even if that something is
&lt;br&gt;&amp;gt; re-releasing Apache::DBI 1.06 as 1.08 (as pgollucci said he was going to
&lt;br&gt;&amp;gt; do over a year and a half ago).
&lt;br&gt;&lt;br&gt;First thing we will need is a patch that doesn't fail when applied - [1].
&lt;br&gt;&lt;br&gt;I may be able to clean it up this week and run the test suite against it.
&lt;br&gt;&lt;br&gt;[1]
&lt;br&gt;svn phred@pooky ~/dev/svn/modperl/Apache-DBI/trunk $ svn update
&lt;br&gt;At revision 890520.
&lt;br&gt;phred@pooky ~/dev/svn/modperl/Apache-DBI/trunk $ patch -p0 &amp;lt; p.patch
&lt;br&gt;patching file lib/Apache/DBI.pm
&lt;br&gt;Hunk #1 succeeded at 39 with fuzz 2.
&lt;br&gt;Hunk #2 FAILED at 124.
&lt;br&gt;Hunk #3 FAILED at 136.
&lt;br&gt;Hunk #4 FAILED at 222.
&lt;br&gt;Hunk #5 succeeded at 236 with fuzz 1.
&lt;br&gt;3 out of 5 hunks FAILED -- saving rejects to file lib/Apache/DBI.pm.rej
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Adam
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -------- Original Message --------
&lt;br&gt;&amp;gt; Subject: Re: Apache::DBI
&lt;br&gt;&amp;gt; Date: Mon, 27 Jul 2009 00:06:07 -0400
&lt;br&gt;&amp;gt; From: Adam Prime &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786355&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;adam.prime@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; To: Fred Moyer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786355&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;fred@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; CC: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786355&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev@...&lt;/a&gt;
&lt;br&gt;&amp;gt; References: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786355&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;4A65C9A1.70602@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786355&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;4A65EC64.4060804@...&lt;/a&gt;&amp;gt;     &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786355&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;4A65FE8E.1020205@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786355&amp;i=7&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;4A6610A1.7020900@...&lt;/a&gt;&amp;gt;   &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786355&amp;i=8&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;4A6689E0.2030401@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786355&amp;i=9&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ad28918e0907220152o6cfe5272r5280d8b19f1f6161@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786355&amp;i=10&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;4A6708EE.7030104@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Adam Prime wrote:
&lt;br&gt;&amp;gt;&amp;gt; Fred Moyer wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; On Tue, Jul 21, 2009 at 8:39 PM, Adam Prime&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786355&amp;i=11&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;adam.prime@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Adam Prime wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; What I wanted to do was fix this issue:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://rt.cpan.org/Public/Bug/Display.html?id=36346&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rt.cpan.org/Public/Bug/Display.html?id=36346&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I was just looking over your original code where you connect() in
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; startup.pl.  Won't that cause issues since the database handle will be
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; forked also?  Here's what I have in my startup.pl:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; The code in the ticket was just to illustrate the failure.  I ran into
&lt;br&gt;&amp;gt;&amp;gt; this problem because I wanted to preload a large read-only datastructure
&lt;br&gt;&amp;gt;&amp;gt; out of the database prior to the fork to get it completely shared
&lt;br&gt;&amp;gt;&amp;gt; between all the children.  The handle itself is then disconnected and
&lt;br&gt;&amp;gt;&amp;gt; discarded.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Adam
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The patch attached ads code to bail out of connect() calls called prior
&lt;br&gt;&amp;gt; to the fork by setting a package global during the ChildInit phase,
&lt;br&gt;&amp;gt; along with the other patch which was submitted to the users mailing list.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; It works fine for me in extremely limited testing.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thoughts?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Adam
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Index: lib/Apache/DBI.pm
&lt;br&gt;&amp;gt; ===================================================================
&lt;br&gt;&amp;gt; --- lib/Apache/DBI.pm   (revision 796605)
&lt;br&gt;&amp;gt; +++ lib/Apache/DBI.pm   (working copy)
&lt;br&gt;&amp;gt; @@ -39,6 +39,9 @@
&lt;br&gt;&amp;gt;                                 #   a negative value de-activates ping,
&lt;br&gt;&amp;gt;                                 #   default = 0
&lt;br&gt;&amp;gt;  my %LastPingTime;               # keeps track of last ping per data_source
&lt;br&gt;&amp;gt; +my $ChildExitHandlerInstalled;  # set to true on installation of
&lt;br&gt;&amp;gt; +                                # PerlChildExitHandler
&lt;br&gt;&amp;gt; +my $InChild;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;  # Check to see if we need to reset TaintIn and TaintOut
&lt;br&gt;&amp;gt;  my $TaintInOut = ($DBI::VERSION &amp;gt;= 1.31) ? 1 : 0;
&lt;br&gt;&amp;gt; @@ -121,8 +124,7 @@
&lt;br&gt;&amp;gt;     # unpredictable query results.
&lt;br&gt;&amp;gt;     # See: &lt;a href=&quot;http://perl.apache.org/docs/2.0/user/porting/compat.html#C__Apache__Server__Starting__and_C__Apache__Server__ReStarting_&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://perl.apache.org/docs/2.0/user/porting/compat.html#C__Apache__Server__Starting__and_C__Apache__Server__ReStarting_&lt;/a&gt;&lt;br&gt;&amp;gt;     if (MP2) {
&lt;br&gt;&amp;gt; -        require Apache2::ServerUtil;
&lt;br&gt;&amp;gt; -        if (Apache2::ServerUtil::restart_count() == 1) {
&lt;br&gt;&amp;gt; +        if (!$InChild) {
&lt;br&gt;&amp;gt;             debug(2, &amp;quot;$prefix skipping connection during server startup, read the docu !!&amp;quot;);
&lt;br&gt;&amp;gt;             return $drh-&amp;gt;connect(@args);
&lt;br&gt;&amp;gt;         }
&lt;br&gt;&amp;gt; @@ -134,6 +136,23 @@
&lt;br&gt;&amp;gt;         }
&lt;br&gt;&amp;gt;     }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; +    # this PerlChildExitHandler is supposed to disconnect all open
&lt;br&gt;&amp;gt; +    # connections to the database
&lt;br&gt;&amp;gt; +    if (!$ChildExitHandlerInstalled) {
&lt;br&gt;&amp;gt; +        $ChildExitHandlerInstalled = 1;
&lt;br&gt;&amp;gt; +        my $s;
&lt;br&gt;&amp;gt; +        if (MP2) {
&lt;br&gt;&amp;gt; +            $s = Apache2::ServerUtil-&amp;gt;server;
&lt;br&gt;&amp;gt; +        }
&lt;br&gt;&amp;gt; +        elsif (Apache-&amp;gt;can('push_handlers')) {
&lt;br&gt;&amp;gt; +            $s = 'Apache';
&lt;br&gt;&amp;gt; +        }
&lt;br&gt;&amp;gt; +        if ($s) {
&lt;br&gt;&amp;gt; +            debug(2, &amp;quot;$prefix push PerlChildExitHandler&amp;quot;);
&lt;br&gt;&amp;gt; +            $s-&amp;gt;push_handlers(PerlChildExitHandler =&amp;gt; \&amp;childexit);
&lt;br&gt;&amp;gt; +        }
&lt;br&gt;&amp;gt; +    }
&lt;br&gt;&amp;gt; +
&lt;br&gt;&amp;gt;     # this PerlCleanupHandler is supposed to initiate a rollback after the
&lt;br&gt;&amp;gt;     # script has finished if AutoCommit is off.  however, cleanup can only
&lt;br&gt;&amp;gt;     # be determined at end of handle life as begin_work may have been called
&lt;br&gt;&amp;gt; @@ -203,6 +222,7 @@
&lt;br&gt;&amp;gt;     my $prefix = &amp;quot;$$ Apache::DBI            &amp;quot;;
&lt;br&gt;&amp;gt;     debug(2, &amp;quot;$prefix PerlChildInitHandler&amp;quot;);
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; +    $InChild = 1;
&lt;br&gt;&amp;gt;     %Connected = () if MP2;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;     if (@ChildConnect) {
&lt;br&gt;&amp;gt; @@ -216,6 +236,22 @@
&lt;br&gt;&amp;gt;     1;
&lt;br&gt;&amp;gt;  }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; +# The PerlChildExitHandler disconnects all open connections
&lt;br&gt;&amp;gt; +sub childexit {
&lt;br&gt;&amp;gt; +
&lt;br&gt;&amp;gt; +    my $prefix = &amp;quot;$$ Apache::DBI            &amp;quot;;
&lt;br&gt;&amp;gt; +    debug(2, &amp;quot;$prefix PerlChildExitHandler&amp;quot;);
&lt;br&gt;&amp;gt; +
&lt;br&gt;&amp;gt; +    foreach my $dbh (values(%Connected)) {
&lt;br&gt;&amp;gt; +        eval { DBI::db::disconnect($dbh) };
&lt;br&gt;&amp;gt; +        if ($@) {
&lt;br&gt;&amp;gt; +            debug(2, &amp;quot;$prefix DBI::db::disconnect failed - $@&amp;quot;);
&lt;br&gt;&amp;gt; +        }
&lt;br&gt;&amp;gt; +    }
&lt;br&gt;&amp;gt; +
&lt;br&gt;&amp;gt; +    1;
&lt;br&gt;&amp;gt; +}
&lt;br&gt;&amp;gt; +
&lt;br&gt;&amp;gt;  # The PerlCleanupHandler is supposed to initiate a rollback after the script
&lt;br&gt;&amp;gt;  # has finished if AutoCommit is off.
&lt;br&gt;&amp;gt;  # Note: the PerlCleanupHandler runs after the response has been sent to
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ---------------------------------------------------------------------
&lt;br&gt;&amp;gt; To unsubscribe, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786355&amp;i=12&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;&amp;gt; For additional commands, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786355&amp;i=13&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786355&amp;i=14&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26786355&amp;i=15&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---Dev-f187.html&quot; embed=&quot;fixTarget[187]&quot; target=&quot;_top&quot; &gt;mod_perl - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-Fwd%3A-Re%3A-Apache%3A%3ADBI--tp26785119p26786355.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26785119</id>
	<title>[Fwd: Re: Apache::DBI]</title>
	<published>2009-12-14T13:22:13Z</published>
	<updated>2009-12-14T13:22:13Z</updated>
	<author>
		<name>Adam Prime</name>
	</author>
	<content type="html">This thread is 6 months stale, but Jonathan Swartz just replied to the
&lt;br&gt;RT ticket, and once again brought it to mind.
&lt;br&gt;&lt;br&gt;Can we please do something about this, even if that something is
&lt;br&gt;re-releasing Apache::DBI 1.06 as 1.08 (as pgollucci said he was going to
&lt;br&gt;do over a year and a half ago).
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;&lt;br&gt;Adam
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-------- Original Message --------
&lt;br&gt;Subject: Re: Apache::DBI
&lt;br&gt;Date: Mon, 27 Jul 2009 00:06:07 -0400
&lt;br&gt;From: Adam Prime &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785119&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;adam.prime@...&lt;/a&gt;&amp;gt;
&lt;br&gt;To: Fred Moyer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785119&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;fred@...&lt;/a&gt;&amp;gt;
&lt;br&gt;CC: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785119&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev@...&lt;/a&gt;
&lt;br&gt;References: &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785119&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;4A65C9A1.70602@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785119&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;4A65EC64.4060804@...&lt;/a&gt;&amp;gt;	 &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785119&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;4A65FE8E.1020205@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785119&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;4A6610A1.7020900@...&lt;/a&gt;&amp;gt;	 &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785119&amp;i=7&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;4A6689E0.2030401@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785119&amp;i=8&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ad28918e0907220152o6cfe5272r5280d8b19f1f6161@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785119&amp;i=9&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;4A6708EE.7030104@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Adam Prime wrote:
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Fred Moyer wrote:
&lt;br&gt;&amp;gt;&amp;gt; On Tue, Jul 21, 2009 at 8:39 PM, Adam Prime&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785119&amp;i=10&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;adam.prime@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Adam Prime wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; What I wanted to do was fix this issue:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://rt.cpan.org/Public/Bug/Display.html?id=36346&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rt.cpan.org/Public/Bug/Display.html?id=36346&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; I was just looking over your original code where you connect() in
&lt;br&gt;&amp;gt;&amp;gt; startup.pl. &amp;nbsp;Won't that cause issues since the database handle will be
&lt;br&gt;&amp;gt;&amp;gt; forked also? &amp;nbsp;Here's what I have in my startup.pl:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The code in the ticket was just to illustrate the failure. &amp;nbsp;I ran into
&lt;br&gt;&amp;gt; this problem because I wanted to preload a large read-only datastructure
&lt;br&gt;&amp;gt; out of the database prior to the fork to get it completely shared
&lt;br&gt;&amp;gt; between all the children. &amp;nbsp;The handle itself is then disconnected and
&lt;br&gt;&amp;gt; discarded.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Adam
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;/div&gt;The patch attached ads code to bail out of connect() calls called prior
&lt;br&gt;to the fork by setting a package global during the ChildInit phase,
&lt;br&gt;along with the other patch which was submitted to the users mailing list.
&lt;br&gt;&lt;br&gt;It works fine for me in extremely limited testing.
&lt;br&gt;&lt;br&gt;Thoughts?
&lt;br&gt;&lt;br&gt;Adam
&lt;br&gt;&lt;br&gt;&lt;br /&gt;Index: lib/Apache/DBI.pm
&lt;br&gt;===================================================================
&lt;br&gt;--- lib/Apache/DBI.pm	(revision 796605)
&lt;br&gt;+++ lib/Apache/DBI.pm	(working copy)
&lt;br&gt;@@ -39,6 +39,9 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# &amp;nbsp; a negative value de-activates ping,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# &amp;nbsp; default = 0
&lt;br&gt;&amp;nbsp;my %LastPingTime; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # keeps track of last ping per data_source
&lt;br&gt;+my $ChildExitHandlerInstalled; &amp;nbsp;# set to true on installation of
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# PerlChildExitHandler
&lt;br&gt;+my $InChild;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;# Check to see if we need to reset TaintIn and TaintOut
&lt;br&gt;&amp;nbsp;my $TaintInOut = ($DBI::VERSION &amp;gt;= 1.31) ? 1 : 0;
&lt;br&gt;@@ -121,8 +124,7 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;# unpredictable query results.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;# See: &lt;a href=&quot;http://perl.apache.org/docs/2.0/user/porting/compat.html#C__Apache__Server__Starting__and_C__Apache__Server__ReStarting_&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://perl.apache.org/docs/2.0/user/porting/compat.html#C__Apache__Server__Starting__and_C__Apache__Server__ReStarting_&lt;/a&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if (MP2) {
&lt;br&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;require Apache2::ServerUtil;
&lt;br&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (Apache2::ServerUtil::restart_count() == 1) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (!$InChild) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;debug(2, &amp;quot;$prefix skipping connection during server startup, read the docu !!&amp;quot;);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return $drh-&amp;gt;connect(@args);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;@@ -134,6 +136,23 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;# this PerlChildExitHandler is supposed to disconnect all open
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;# connections to the database
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;if (!$ChildExitHandlerInstalled) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$ChildExitHandlerInstalled = 1;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;my $s;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (MP2) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$s = Apache2::ServerUtil-&amp;gt;server;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;elsif (Apache-&amp;gt;can('push_handlers')) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$s = 'Apache';
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ($s) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;debug(2, &amp;quot;$prefix push PerlChildExitHandler&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$s-&amp;gt;push_handlers(PerlChildExitHandler =&amp;gt; \&amp;childexit);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;# this PerlCleanupHandler is supposed to initiate a rollback after the
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;# script has finished if AutoCommit is off. &amp;nbsp;however, cleanup can only
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;# be determined at end of handle life as begin_work may have been called
&lt;br&gt;@@ -203,6 +222,7 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;my $prefix = &amp;quot;$$ Apache::DBI &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;debug(2, &amp;quot;$prefix PerlChildInitHandler&amp;quot;);
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;$InChild = 1;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;%Connected = () if MP2;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if (@ChildConnect) {
&lt;br&gt;@@ -216,6 +236,22 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;1;
&lt;br&gt;&amp;nbsp;}
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+# The PerlChildExitHandler disconnects all open connections
&lt;br&gt;+sub childexit {
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;my $prefix = &amp;quot;$$ Apache::DBI &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;debug(2, &amp;quot;$prefix PerlChildExitHandler&amp;quot;);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;foreach my $dbh (values(%Connected)) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;eval { DBI::db::disconnect($dbh) };
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ($@) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;debug(2, &amp;quot;$prefix DBI::db::disconnect failed - $@&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;1;
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;# The PerlCleanupHandler is supposed to initiate a rollback after the script
&lt;br&gt;&amp;nbsp;# has finished if AutoCommit is off.
&lt;br&gt;&amp;nbsp;# Note: the PerlCleanupHandler runs after the response has been sent to
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br /&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785119&amp;i=11&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785119&amp;i=12&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---Dev-f187.html&quot; embed=&quot;fixTarget[187]&quot; target=&quot;_top&quot; &gt;mod_perl - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-Fwd%3A-Re%3A-Apache%3A%3ADBI--tp26785119p26785119.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26782206</id>
	<title>Re: mod_perl waters too deep</title>
	<published>2009-12-14T10:10:58Z</published>
	<updated>2009-12-14T10:10:58Z</updated>
	<author>
		<name>Torsten Foertsch</name>
	</author>
	<content type="html">On Monday 14 December 2009 18:45:01 Tosh Cooey wrote:
&lt;br&gt;&amp;gt; my %config=
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;(
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;clientA=&amp;gt;[
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; ...
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The problem is this creates a LARGE config file for 10,000+ clients, and 
&lt;br&gt;&amp;gt; I'm still naive enough to dream big :)
&lt;br&gt;&amp;gt; 
&lt;br&gt;That %config hash was meant as an example. In the real world you would fetch 
&lt;br&gt;it from a database or something similar. Somewhere you have to store the 
&lt;br&gt;configuration.
&lt;br&gt;&lt;br&gt;Torsten
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/mod_perl-waters-too-deep-tp26779387p26782206.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26781809</id>
	<title>Re: mod_perl waters too deep</title>
	<published>2009-12-14T09:45:01Z</published>
	<updated>2009-12-14T09:45:01Z</updated>
	<author>
		<name>Tosh Cooey-2</name>
	</author>
	<content type="html">The PerlHeaderParserHandler would look like:
&lt;br&gt;&lt;br&gt;my %config=
&lt;br&gt;&amp;nbsp; &amp;nbsp;(
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;clientA=&amp;gt;[
&lt;br&gt;&lt;br&gt;...
&lt;br&gt;&lt;br&gt;The problem is this creates a LARGE config file for 10,000+ clients, and 
&lt;br&gt;I'm still naive enough to dream big :)
&lt;br&gt;&lt;br&gt;Like I noted in a post to Randal, actually overriding the &amp;quot;_dbi_connect&amp;quot; 
&lt;br&gt;sub in the parent was proving to be the problem.
&lt;br&gt;&lt;br&gt;Matisse Enzer, the author of Apache2::AuthCookieDBI told me today that I 
&lt;br&gt;could do so using globs, a voodoo I have never explored before...
&lt;br&gt;&lt;br&gt;*Apache2::AuthCookieDBI::_dbi_connect = sub { my stuff... };
&lt;br&gt;&lt;br&gt;This lets me configure the DBI variables on the fly per request which is 
&lt;br&gt;a nicer way.
&lt;br&gt;&lt;br&gt;The problem now will be to figure out what problems remain.
&lt;br&gt;&lt;br&gt;Tosh
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Torsten Förtsch wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Monday 14 December 2009 16:14:31 Tosh Cooey wrote:
&lt;br&gt;&amp;gt;&amp;gt; You may have seen my other recent questions to the list this month, the
&lt;br&gt;&amp;gt;&amp;gt; gist of which is:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I want to setup an application for multiple clients, each of whom have
&lt;br&gt;&amp;gt;&amp;gt; their own users.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientA/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/application.pl&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientB/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientB/application.pl&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientX/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientX/application.pl&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; So the users of &amp;quot;clientA&amp;quot; log in to
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientA/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/application.pl&lt;/a&gt;&amp;nbsp;and are authenticated with
&lt;br&gt;&amp;gt;&amp;gt; Apache2::AuthCookieDBI
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Now the directories clientA, clientB, etc. do not exist, I'm using
&lt;br&gt;&amp;gt;&amp;gt; mod_rewrite to sort that out, and here starts my problems. &amp;nbsp;First I'm
&lt;br&gt;&amp;gt;&amp;gt; lost with authenticating since there's no &amp;quot;real&amp;quot; resource to
&lt;br&gt;&amp;gt;&amp;gt; authenticate against, but I seem to have solved that by forcing
&lt;br&gt;&amp;gt;&amp;gt; authentication against all *.pl files which luckily do exist ;)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; It gets more complicated later because some URLs like
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientA/iCal&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/iCal&lt;/a&gt;&amp;nbsp;can't use session cookies but have to
&lt;br&gt;&amp;gt;&amp;gt; use BASIC AUTH, and other *.pl files can't have any authentication
&lt;br&gt;&amp;gt;&amp;gt; applied against them.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I thought I could solve this by writing a MyAuthCookieDBI.pm but this
&lt;br&gt;&amp;gt;&amp;gt; also isn't working out. &amp;nbsp;For example MyAuthCookieDBI is an almost-empty
&lt;br&gt;&amp;gt;&amp;gt; child. &amp;nbsp;The parent (Apache2::AuthCookieDBI) has a function
&lt;br&gt;&amp;gt;&amp;gt; _dbi_connect() which manages all the database connecting, but I can't
&lt;br&gt;&amp;gt;&amp;gt; overwrite that function, even if MyAuthCookieDBI is the calling object
&lt;br&gt;&amp;gt;&amp;gt; the function from Apache2::AuthCookieDBI always gets called rather than
&lt;br&gt;&amp;gt;&amp;gt; the overridden function in my object.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; That's kind of the tip of things, basically I'm realizing that I need
&lt;br&gt;&amp;gt;&amp;gt; professional help with this task before I end up requiring professional
&lt;br&gt;&amp;gt;&amp;gt; help for my nerves!
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; So if anyone can help with this then please contact me offlist with terms.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; From reviewing what you have posted I take it the main problem is you have a 
&lt;br&gt;&amp;gt; huge number of clients and don't want to write a .htaccess file for each one, 
&lt;br&gt;&amp;gt; right?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; There are 2 ways to solve this. 1) generate the httpd.conf on startup from the 
&lt;br&gt;&amp;gt; client database adding a &amp;lt;Location&amp;gt; block for each one. That means you'd have 
&lt;br&gt;&amp;gt; to restart apache for each new client.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The second way is to write a simple and short (3-4 lines of code) modperl-
&lt;br&gt;&amp;gt; handler that adds the right configuration directives to the request depending 
&lt;br&gt;&amp;gt; on the url. The trick when to do that within the request cycle.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Auth-directives are applied just after the HeaderParser phase. So, the last 
&lt;br&gt;&amp;gt; chance to add authentication stuff is the header parser phase. Unfortunately 
&lt;br&gt;&amp;gt; this phase is skipped for subrequests. So, if you want to catch subrequests as 
&lt;br&gt;&amp;gt; well MapToStorage is the only way. But it also has its tweaks. So, let's 
&lt;br&gt;&amp;gt; assume you use the HeaderParser phase for a start.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The PerlHeaderParserHandler would look like:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; my %config=
&lt;br&gt;&amp;gt; &amp;nbsp; (
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; clientA=&amp;gt;[
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'AuthType Apache2::AuthCookieDBI',
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'AuthName WhatEver',
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'PerlAuthenHandler Apache2::AuthCookieDBI-&amp;gt;authenticate',
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'PerlAuthzHandler Apache2::AuthCookieDBI-&amp;gt;authorize',
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'require valid-user',
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'PerlSetVar WhatEver... ...',
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;],
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; clientB=&amp;gt;...
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ...
&lt;br&gt;&amp;gt; &amp;nbsp; );
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; sub ... {
&lt;br&gt;&amp;gt; &amp;nbsp; my ($r)=@_;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; return Apache2::Const::DECLINED unless $r-&amp;gt;uri=~m!/([^/]+)!;
&lt;br&gt;&amp;gt; &amp;nbsp; $r-&amp;gt;add_config($config{$1});
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; return Apache2::Const::DECLINED;
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; What now happens is Apache reads in the request then just before deciding if 
&lt;br&gt;&amp;gt; authentication is needed the HeaderParser handler jumps in, looks at the URI 
&lt;br&gt;&amp;gt; and adds the needed configuration stuff.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Perhaps you have a look at my Apache2::Translation on CPAN. I think it's a 
&lt;br&gt;&amp;gt; very handy module for complicated configurations. I wouldn't configure an 
&lt;br&gt;&amp;gt; apache without it anymore and I know some other folks who wouldn't either.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Torsten
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;McIntosh Cooey - Twelve Hundred Group LLC - &lt;a href=&quot;http://www.1200group.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.1200group.com/&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/mod_perl-waters-too-deep-tp26779387p26781809.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26781577</id>
	<title>Re: mod_perl waters too deep</title>
	<published>2009-12-14T09:27:42Z</published>
	<updated>2009-12-14T09:27:42Z</updated>
	<author>
		<name>Tosh Cooey-2</name>
	</author>
	<content type="html">This is one of my options, but it's down at the bottom of my desired 
&lt;br&gt;outcomes. &amp;nbsp;The CGI::Session modules have been getting a lot of reading 
&lt;br&gt;lately ;)
&lt;br&gt;&lt;br&gt;Thanks Jay!
&lt;br&gt;&lt;br&gt;Tosh
&lt;br&gt;&lt;br&gt;&lt;br&gt;Jay Scherrer wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Tosh,
&lt;br&gt;&amp;gt; If your users are already verified or not, try using a switch statement 
&lt;br&gt;&amp;gt; based on their inputs directing them to the needed function.
&lt;br&gt;&amp;gt; If they already have cookie info use that as your switch/case redirection.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Jay Scherrer
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Tosh Cooey wrote:
&lt;br&gt;&amp;gt;&amp;gt; You may have seen my other recent questions to the list this month, 
&lt;br&gt;&amp;gt;&amp;gt; the gist of which is:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I want to setup an application for multiple clients, each of whom have 
&lt;br&gt;&amp;gt;&amp;gt; their own users.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientA/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/application.pl&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientB/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientB/application.pl&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientX/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientX/application.pl&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; So the users of &amp;quot;clientA&amp;quot; log in to 
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientA/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/application.pl&lt;/a&gt;&amp;nbsp;and are authenticated with 
&lt;br&gt;&amp;gt;&amp;gt; Apache2::AuthCookieDBI
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Now the directories clientA, clientB, etc. do not exist, I'm using 
&lt;br&gt;&amp;gt;&amp;gt; mod_rewrite to sort that out, and here starts my problems. &amp;nbsp;First I'm 
&lt;br&gt;&amp;gt;&amp;gt; lost with authenticating since there's no &amp;quot;real&amp;quot; resource to 
&lt;br&gt;&amp;gt;&amp;gt; authenticate against, but I seem to have solved that by forcing 
&lt;br&gt;&amp;gt;&amp;gt; authentication against all *.pl files which luckily do exist ;)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; It gets more complicated later because some URLs like
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientA/iCal&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/iCal&lt;/a&gt;&amp;nbsp;can't use session cookies but have to 
&lt;br&gt;&amp;gt;&amp;gt; use BASIC AUTH, and other *.pl files can't have any authentication 
&lt;br&gt;&amp;gt;&amp;gt; applied against them.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I thought I could solve this by writing a MyAuthCookieDBI.pm but this 
&lt;br&gt;&amp;gt;&amp;gt; also isn't working out. &amp;nbsp;For example MyAuthCookieDBI is an 
&lt;br&gt;&amp;gt;&amp;gt; almost-empty child. &amp;nbsp;The parent (Apache2::AuthCookieDBI) has a 
&lt;br&gt;&amp;gt;&amp;gt; function _dbi_connect() which manages all the database connecting, but 
&lt;br&gt;&amp;gt;&amp;gt; I can't overwrite that function, even if MyAuthCookieDBI is the 
&lt;br&gt;&amp;gt;&amp;gt; calling object the function from Apache2::AuthCookieDBI always gets 
&lt;br&gt;&amp;gt;&amp;gt; called rather than the overridden function in my object.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; That's kind of the tip of things, basically I'm realizing that I need 
&lt;br&gt;&amp;gt;&amp;gt; professional help with this task before I end up requiring 
&lt;br&gt;&amp;gt;&amp;gt; professional help for my nerves!
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; So if anyone can help with this then please contact me offlist with 
&lt;br&gt;&amp;gt;&amp;gt; terms.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Thanks!
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Tosh
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;McIntosh Cooey - Twelve Hundred Group LLC - &lt;a href=&quot;http://www.1200group.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.1200group.com/&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/mod_perl-waters-too-deep-tp26779387p26781577.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26781422</id>
	<title>Re: mod_perl waters too deep</title>
	<published>2009-12-14T09:16:09Z</published>
	<updated>2009-12-14T09:16:09Z</updated>
	<author>
		<name>Jay Scherrer</name>
	</author>
	<content type="html">Tosh,
&lt;br&gt;If your users are already verified or not, try using a switch statement 
&lt;br&gt;based on their inputs directing them to the needed function.
&lt;br&gt;If they already have cookie info use that as your switch/case redirection.
&lt;br&gt;&lt;br&gt;Jay Scherrer
&lt;br&gt;&lt;br&gt;Tosh Cooey wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; You may have seen my other recent questions to the list this month, the 
&lt;br&gt;&amp;gt; gist of which is:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I want to setup an application for multiple clients, each of whom have 
&lt;br&gt;&amp;gt; their own users.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientA/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/application.pl&lt;/a&gt;&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientB/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientB/application.pl&lt;/a&gt;&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientX/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientX/application.pl&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; So the users of &amp;quot;clientA&amp;quot; log in to 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientA/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/application.pl&lt;/a&gt;&amp;nbsp;and are authenticated with 
&lt;br&gt;&amp;gt; Apache2::AuthCookieDBI
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Now the directories clientA, clientB, etc. do not exist, I'm using 
&lt;br&gt;&amp;gt; mod_rewrite to sort that out, and here starts my problems. &amp;nbsp;First I'm 
&lt;br&gt;&amp;gt; lost with authenticating since there's no &amp;quot;real&amp;quot; resource to 
&lt;br&gt;&amp;gt; authenticate against, but I seem to have solved that by forcing 
&lt;br&gt;&amp;gt; authentication against all *.pl files which luckily do exist ;)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; It gets more complicated later because some URLs like
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientA/iCal&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/iCal&lt;/a&gt;&amp;nbsp;can't use session cookies but have to 
&lt;br&gt;&amp;gt; use BASIC AUTH, and other *.pl files can't have any authentication 
&lt;br&gt;&amp;gt; applied against them.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I thought I could solve this by writing a MyAuthCookieDBI.pm but this 
&lt;br&gt;&amp;gt; also isn't working out. &amp;nbsp;For example MyAuthCookieDBI is an almost-empty 
&lt;br&gt;&amp;gt; child. &amp;nbsp;The parent (Apache2::AuthCookieDBI) has a function 
&lt;br&gt;&amp;gt; _dbi_connect() which manages all the database connecting, but I can't 
&lt;br&gt;&amp;gt; overwrite that function, even if MyAuthCookieDBI is the calling object 
&lt;br&gt;&amp;gt; the function from Apache2::AuthCookieDBI always gets called rather than 
&lt;br&gt;&amp;gt; the overridden function in my object.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; That's kind of the tip of things, basically I'm realizing that I need 
&lt;br&gt;&amp;gt; professional help with this task before I end up requiring professional 
&lt;br&gt;&amp;gt; help for my nerves!
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; So if anyone can help with this then please contact me offlist with terms.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thanks!
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Tosh
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;Register for your free &amp;quot;Debt reduction Calculator&amp;quot;
&lt;br&gt;&amp;lt;&lt;a href=&quot;https://www.myhelpingbuildwealth.com/agent/jayscherrer&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://www.myhelpingbuildwealth.com/agent/jayscherrer&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Update your WILL with
&lt;br&gt;Heritage Living Trusts
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://www.heritagelivingtrust.com/JayScherrer.aspx&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.heritagelivingtrust.com/JayScherrer.aspx&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;=====
&lt;br&gt;THE INFORMATION CONTAINED IN THIS ELECTRONIC MAIL MESSAGE IS PRIVILEGED 
&lt;br&gt;AND CONFIDENTIAL. THIS MESSAGE IS INTENDED ONLY FOR THE USE OF THE 
&lt;br&gt;PERSON OR ENTITY TO WHOM IT IS ADDRESSED ABOVE. If the reader of this 
&lt;br&gt;message is not the intended recipient, you are hereby notified that any 
&lt;br&gt;dissemination, distribution or copying of this communication is 
&lt;br&gt;prohibited. If you have received this communication in error, please 
&lt;br&gt;notify me immediately by reply email, permanently delete the original 
&lt;br&gt;and any copy of this email from your system and destroy any printout 
&lt;br&gt;thereof.
&lt;br&gt;=====
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/mod_perl-waters-too-deep-tp26779387p26781422.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26781045</id>
	<title>Re: mod_perl waters too deep</title>
	<published>2009-12-14T08:53:20Z</published>
	<updated>2009-12-14T08:53:20Z</updated>
	<author>
		<name>Torsten Foertsch</name>
	</author>
	<content type="html">On Monday 14 December 2009 16:14:31 Tosh Cooey wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; You may have seen my other recent questions to the list this month, the
&lt;br&gt;&amp;gt; gist of which is:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I want to setup an application for multiple clients, each of whom have
&lt;br&gt;&amp;gt; their own users.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientA/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/application.pl&lt;/a&gt;&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientB/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientB/application.pl&lt;/a&gt;&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientX/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientX/application.pl&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; So the users of &amp;quot;clientA&amp;quot; log in to
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientA/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/application.pl&lt;/a&gt;&amp;nbsp;and are authenticated with
&lt;br&gt;&amp;gt; Apache2::AuthCookieDBI
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Now the directories clientA, clientB, etc. do not exist, I'm using
&lt;br&gt;&amp;gt; mod_rewrite to sort that out, and here starts my problems. &amp;nbsp;First I'm
&lt;br&gt;&amp;gt; lost with authenticating since there's no &amp;quot;real&amp;quot; resource to
&lt;br&gt;&amp;gt; authenticate against, but I seem to have solved that by forcing
&lt;br&gt;&amp;gt; authentication against all *.pl files which luckily do exist ;)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; It gets more complicated later because some URLs like
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientA/iCal&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/iCal&lt;/a&gt;&amp;nbsp;can't use session cookies but have to
&lt;br&gt;&amp;gt; use BASIC AUTH, and other *.pl files can't have any authentication
&lt;br&gt;&amp;gt; applied against them.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I thought I could solve this by writing a MyAuthCookieDBI.pm but this
&lt;br&gt;&amp;gt; also isn't working out. &amp;nbsp;For example MyAuthCookieDBI is an almost-empty
&lt;br&gt;&amp;gt; child. &amp;nbsp;The parent (Apache2::AuthCookieDBI) has a function
&lt;br&gt;&amp;gt; _dbi_connect() which manages all the database connecting, but I can't
&lt;br&gt;&amp;gt; overwrite that function, even if MyAuthCookieDBI is the calling object
&lt;br&gt;&amp;gt; the function from Apache2::AuthCookieDBI always gets called rather than
&lt;br&gt;&amp;gt; the overridden function in my object.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; That's kind of the tip of things, basically I'm realizing that I need
&lt;br&gt;&amp;gt; professional help with this task before I end up requiring professional
&lt;br&gt;&amp;gt; help for my nerves!
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; So if anyone can help with this then please contact me offlist with terms.
&lt;/div&gt;&lt;br&gt;From reviewing what you have posted I take it the main problem is you have a 
&lt;br&gt;huge number of clients and don't want to write a .htaccess file for each one, 
&lt;br&gt;right?
&lt;br&gt;&lt;br&gt;There are 2 ways to solve this. 1) generate the httpd.conf on startup from the 
&lt;br&gt;client database adding a &amp;lt;Location&amp;gt; block for each one. That means you'd have 
&lt;br&gt;to restart apache for each new client.
&lt;br&gt;&lt;br&gt;The second way is to write a simple and short (3-4 lines of code) modperl-
&lt;br&gt;handler that adds the right configuration directives to the request depending 
&lt;br&gt;on the url. The trick when to do that within the request cycle.
&lt;br&gt;&lt;br&gt;Auth-directives are applied just after the HeaderParser phase. So, the last 
&lt;br&gt;chance to add authentication stuff is the header parser phase. Unfortunately 
&lt;br&gt;this phase is skipped for subrequests. So, if you want to catch subrequests as 
&lt;br&gt;well MapToStorage is the only way. But it also has its tweaks. So, let's 
&lt;br&gt;assume you use the HeaderParser phase for a start.
&lt;br&gt;&lt;br&gt;The PerlHeaderParserHandler would look like:
&lt;br&gt;&lt;br&gt;my %config=
&lt;br&gt;&amp;nbsp; (
&lt;br&gt;&amp;nbsp; &amp;nbsp; clientA=&amp;gt;[
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'AuthType Apache2::AuthCookieDBI',
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'AuthName WhatEver',
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'PerlAuthenHandler Apache2::AuthCookieDBI-&amp;gt;authenticate',
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'PerlAuthzHandler Apache2::AuthCookieDBI-&amp;gt;authorize',
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'require valid-user',
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'PerlSetVar WhatEver... ...',
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;],
&lt;br&gt;&amp;nbsp; &amp;nbsp; clientB=&amp;gt;...
&lt;br&gt;&amp;nbsp; &amp;nbsp; ...
&lt;br&gt;&amp;nbsp; );
&lt;br&gt;&lt;br&gt;sub ... {
&lt;br&gt;&amp;nbsp; my ($r)=@_;
&lt;br&gt;&lt;br&gt;&amp;nbsp; return Apache2::Const::DECLINED unless $r-&amp;gt;uri=~m!/([^/]+)!;
&lt;br&gt;&amp;nbsp; $r-&amp;gt;add_config($config{$1});
&lt;br&gt;&lt;br&gt;&amp;nbsp; return Apache2::Const::DECLINED;
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;What now happens is Apache reads in the request then just before deciding if 
&lt;br&gt;authentication is needed the HeaderParser handler jumps in, looks at the URI 
&lt;br&gt;and adds the needed configuration stuff.
&lt;br&gt;&lt;br&gt;Perhaps you have a look at my Apache2::Translation on CPAN. I think it's a 
&lt;br&gt;very handy module for complicated configurations. I wouldn't configure an 
&lt;br&gt;apache without it anymore and I know some other folks who wouldn't either.
&lt;br&gt;&lt;br&gt;Torsten
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/mod_perl-waters-too-deep-tp26779387p26781045.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26780780</id>
	<title>Re: mod_perl waters too deep</title>
	<published>2009-12-14T08:36:56Z</published>
	<updated>2009-12-14T08:36:56Z</updated>
	<author>
		<name>awarnier</name>
	</author>
	<content type="html">Tosh Cooey wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; You may have seen my other recent questions to the list this month, the 
&lt;br&gt;&amp;gt; gist of which is:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I want to setup an application for multiple clients, each of whom have 
&lt;br&gt;&amp;gt; their own users.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientA/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/application.pl&lt;/a&gt;&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientB/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientB/application.pl&lt;/a&gt;&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientX/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientX/application.pl&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; So the users of &amp;quot;clientA&amp;quot; log in to 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientA/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/application.pl&lt;/a&gt;&amp;nbsp;and are authenticated with 
&lt;br&gt;&amp;gt; Apache2::AuthCookieDBI
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Now the directories clientA, clientB, etc. do not exist, I'm using 
&lt;br&gt;&amp;gt; mod_rewrite to sort that out, and here starts my problems. &amp;nbsp;First I'm 
&lt;br&gt;&amp;gt; lost with authenticating since there's no &amp;quot;real&amp;quot; resource to 
&lt;br&gt;&amp;gt; authenticate against, but I seem to have solved that by forcing 
&lt;br&gt;&amp;gt; authentication against all *.pl files which luckily do exist ;)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; It gets more complicated later because some URLs like
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientA/iCal&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/iCal&lt;/a&gt;&amp;nbsp;can't use session cookies but have to 
&lt;br&gt;&amp;gt; use BASIC AUTH, and other *.pl files can't have any authentication 
&lt;br&gt;&amp;gt; applied against them.
&lt;/div&gt;&lt;br&gt;Hi. &amp;nbsp;I kind of remember your posts, and kind of remember also that I 
&lt;br&gt;thought that you were going about this the hard way.
&lt;br&gt;&lt;br&gt;I am more than willing to assist you professionally (since that's what I 
&lt;br&gt;do for a living), but in the meantime, what stops you from doing 
&lt;br&gt;something like this :
&lt;br&gt;&lt;br&gt;&amp;lt;Location /clientA&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp;AuthType MyOwn
&lt;br&gt;&amp;nbsp; &amp;nbsp;PerlSetVar MyAuthType &amp;quot;form&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp;PerlAuthenHandler my::module::dbi-based
&lt;br&gt;&amp;nbsp; &amp;nbsp;...
&lt;br&gt;&amp;lt;/Location&amp;gt;
&lt;br&gt;&amp;lt;Location /clientA/iCal&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp;AuthType MyOwn
&lt;br&gt;&amp;nbsp; &amp;nbsp;PerlSetVar MyAuthType &amp;quot;basic&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp;PerlAuthenHandler my::module::dbi-based (or whatever)
&lt;br&gt;&amp;nbsp; &amp;nbsp;...
&lt;br&gt;&amp;lt;/Location&amp;gt;
&lt;br&gt;&amp;lt;Location /clientA/somescript.pl&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp;AuthType nothing
&lt;br&gt;&amp;nbsp; &amp;nbsp;PerlSetVar MyAuthType &amp;quot;auto&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp;PerlSetVar MyAutoId &amp;quot;anonymous&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp;PerlAuthenHandler my::module::dbi-based (or whatever)
&lt;br&gt;&amp;lt;/Location&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;lt;Location /clientB&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp;AuthType MyOwn
&lt;br&gt;&amp;nbsp; &amp;nbsp;PerlSetVar MyAuthType &amp;quot;form&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp;PerlAuthenHandler my::module::dbi-based
&lt;br&gt;&amp;nbsp; &amp;nbsp;...
&lt;br&gt;&amp;lt;/Location&amp;gt;
&lt;br&gt;&amp;lt;Location /clientB/iCal&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp;AuthType MyOwn
&lt;br&gt;&amp;nbsp; &amp;nbsp;PerlSetVar MyAuthType &amp;quot;basic&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp;PerlAuthenHandler my::module::dbi-based (or whatever)
&lt;br&gt;&amp;nbsp; &amp;nbsp;...
&lt;br&gt;&amp;lt;/Location&amp;gt;
&lt;br&gt;etc...
&lt;br&gt;&lt;br&gt;(You can use LocationMatch in case you need finer control)
&lt;br&gt;&lt;br&gt;If you really have only a few different &amp;quot;clientX&amp;quot;, then that seems like 
&lt;br&gt;an easy enough configuration.
&lt;br&gt;(If you have many, then it may be easier to do this another way, and 
&lt;br&gt;have your module determine which &amp;quot;clientX&amp;quot; this is and react appropriately.)
&lt;br&gt;&lt;br&gt;&lt;br&gt;Apache itself will pick the &amp;quot;most precise&amp;quot; matching Location section 
&lt;br&gt;applying to the request URL.
&lt;br&gt;Your authentication module should check on $r-&amp;gt;dir_config('MyAuthType') 
&lt;br&gt;to determine what kind of authentication to use with the client 
&lt;br&gt;(form-based, basic or none).
&lt;br&gt;&lt;br&gt;Maybe it is not time for a nervous breakdown yet..
&lt;br&gt;;-)
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/mod_perl-waters-too-deep-tp26779387p26780780.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26780607</id>
	<title>Re: mod_perl waters too deep</title>
	<published>2009-12-14T08:25:02Z</published>
	<updated>2009-12-14T08:25:02Z</updated>
	<author>
		<name>Tosh Cooey-2</name>
	</author>
	<content type="html">Hi Randal, sorry my message wasn't concise enough, perhaps I was letting 
&lt;br&gt;the haze of it reflect my haze of this problem...
&lt;br&gt;&lt;br&gt;Anyway, this is not a hosting environment. &amp;nbsp;This is an application, for 
&lt;br&gt;example like GMail for Business is an email application that lets a 
&lt;br&gt;business, like mine, go to:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://mail.google.com/a/1200group.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://mail.google.com/a/1200group.com/&lt;/a&gt;&lt;br&gt;&lt;br&gt;There my users can log in and check their mails.
&lt;br&gt;&lt;br&gt;I assume the &amp;quot;1200group.com&amp;quot; is being used as a key to identify which 
&lt;br&gt;database to lookup the users in, or something similar.
&lt;br&gt;&lt;br&gt;I want to accomplish the same:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.site.com/clientA/calendar.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/calendar.pl&lt;/a&gt;&lt;br&gt;&lt;br&gt;So all users of &amp;quot;clientA&amp;quot;, if they go to the above link, would be 
&lt;br&gt;prompted to log in and my MyAuthCookieDBI would handle this on the fly.
&lt;br&gt;&lt;br&gt;On a side note, Matisse Enzer the author of Apache2::AuthCookieDBI just 
&lt;br&gt;informed me that I can override the methods in his module like this:
&lt;br&gt;&lt;br&gt;*Apache2::AuthCookieDBI::_dbi_connect = sub { # your code goes here };
&lt;br&gt;&lt;br&gt;So there seems to be some light at the end of the tunnel, but I do see a 
&lt;br&gt;large truck coming towards me in the form of the next problem which is I 
&lt;br&gt;need different authentication methods for different uses of my 
&lt;br&gt;application. &amp;nbsp;I'm not too sure if I can change Auth methods on the fly 
&lt;br&gt;in MyAuthCookieDBI, or if I need to assign these different 
&lt;br&gt;authentication schemes to different path directives. &amp;nbsp;I suspect the 
&lt;br&gt;small light at the end of my tunnel is in fact a bullet train...
&lt;br&gt;&lt;br&gt;Thanks again for letting me clarify Randal!
&lt;br&gt;&lt;br&gt;Tosh
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Randal L. Schwartz wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;quot;Tosh&amp;quot; == Tosh Cooey &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26780607&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;tosh@...&lt;/a&gt;&amp;gt; writes:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Tosh&amp;gt; I want to setup an application for multiple clients, each of whom have their
&lt;br&gt;&amp;gt; Tosh&amp;gt; own users.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Tosh&amp;gt; &lt;a href=&quot;http://www.site.com/clientA/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/application.pl&lt;/a&gt;&lt;br&gt;&amp;gt; Tosh&amp;gt; &lt;a href=&quot;http://www.site.com/clientB/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientB/application.pl&lt;/a&gt;&lt;br&gt;&amp;gt; Tosh&amp;gt; &lt;a href=&quot;http://www.site.com/clientX/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientX/application.pl&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Just an aside, but
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; (a) can your clients load their own code onto the server without you
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; intervening, and if so
&lt;br&gt;&amp;gt; (b) do all of your clients *absolutely* trust each other?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I'm saying this because I'm not sure if you realize that the trust domain for
&lt;br&gt;&amp;gt; mod_perl is the entire server. &amp;nbsp;If I can upload code to the same server you're
&lt;br&gt;&amp;gt; using, I can mess up your day, pretty bad, because the Perl interpreters are
&lt;br&gt;&amp;gt; necessarily shared.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; For example, I can patch the loaded CGI.pm so that if it sees your code and a
&lt;br&gt;&amp;gt; secret extra parameter, it automatically gives me complete access to your
&lt;br&gt;&amp;gt; data.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This is why there are no &amp;quot;shared hosting&amp;quot; plans for mod_perl that don't
&lt;br&gt;&amp;gt; require running completely separate clusters of apache servers. &amp;nbsp;There's
&lt;br&gt;&amp;gt; nothing like &amp;quot;su-exec&amp;quot; for mod_perl - it's not even possible.
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;McIntosh Cooey - Twelve Hundred Group LLC - &lt;a href=&quot;http://www.1200group.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.1200group.com/&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/mod_perl-waters-too-deep-tp26779387p26780607.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26780125</id>
	<title>Re: mod_perl waters too deep</title>
	<published>2009-12-14T07:55:58Z</published>
	<updated>2009-12-14T07:55:58Z</updated>
	<author>
		<name>Randal L. Schwartz</name>
	</author>
	<content type="html">&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;quot;Tosh&amp;quot; == Tosh Cooey &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26780125&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;tosh@...&lt;/a&gt;&amp;gt; writes:
&lt;br&gt;&lt;br&gt;Tosh&amp;gt; I want to setup an application for multiple clients, each of whom have their
&lt;br&gt;Tosh&amp;gt; own users.
&lt;br&gt;&lt;br&gt;Tosh&amp;gt; &lt;a href=&quot;http://www.site.com/clientA/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/application.pl&lt;/a&gt;&lt;br&gt;Tosh&amp;gt; &lt;a href=&quot;http://www.site.com/clientB/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientB/application.pl&lt;/a&gt;&lt;br&gt;Tosh&amp;gt; &lt;a href=&quot;http://www.site.com/clientX/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientX/application.pl&lt;/a&gt;&lt;br&gt;&lt;br&gt;Just an aside, but
&lt;br&gt;&lt;br&gt;(a) can your clients load their own code onto the server without you
&lt;br&gt;&amp;nbsp; &amp;nbsp; intervening, and if so
&lt;br&gt;(b) do all of your clients *absolutely* trust each other?
&lt;br&gt;&lt;br&gt;I'm saying this because I'm not sure if you realize that the trust domain for
&lt;br&gt;mod_perl is the entire server. &amp;nbsp;If I can upload code to the same server you're
&lt;br&gt;using, I can mess up your day, pretty bad, because the Perl interpreters are
&lt;br&gt;necessarily shared.
&lt;br&gt;&lt;br&gt;For example, I can patch the loaded CGI.pm so that if it sees your code and a
&lt;br&gt;secret extra parameter, it automatically gives me complete access to your
&lt;br&gt;data.
&lt;br&gt;&lt;br&gt;This is why there are no &amp;quot;shared hosting&amp;quot; plans for mod_perl that don't
&lt;br&gt;require running completely separate clusters of apache servers. &amp;nbsp;There's
&lt;br&gt;nothing like &amp;quot;su-exec&amp;quot; for mod_perl - it's not even possible.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26780125&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;merlyn@...&lt;/a&gt;&amp;gt; &amp;lt;URL:&lt;a href=&quot;http://www.stonehenge.com/merlyn/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.stonehenge.com/merlyn/&lt;/a&gt;&amp;gt;
&lt;br&gt;Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
&lt;br&gt;See &lt;a href=&quot;http://methodsandmessages.vox.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://methodsandmessages.vox.com/&lt;/a&gt;&amp;nbsp;for Smalltalk and Seaside discussion
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/mod_perl-waters-too-deep-tp26779387p26780125.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26779502</id>
	<title>Re: mod_perl waters too deep</title>
	<published>2009-12-14T07:22:22Z</published>
	<updated>2009-12-14T07:22:22Z</updated>
	<author>
		<name>Kurt Hansen-2</name>
	</author>
	<content type="html">Hi Tosh,
&lt;br&gt;&lt;br&gt;Have you considered using a Web framework like Catalyst? I haven't used 
&lt;br&gt;Catalyst, but a cursory read of your problems makes me think that a Web 
&lt;br&gt;framework may have already solved most of your problems.
&lt;br&gt;&lt;br&gt;Take care,
&lt;br&gt;&lt;br&gt;Kurt Hansen
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26779502&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;khansen@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;Tosh Cooey wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; You may have seen my other recent questions to the list this month, 
&lt;br&gt;&amp;gt; the gist of which is:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I want to setup an application for multiple clients, each of whom have 
&lt;br&gt;&amp;gt; their own users.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientA/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/application.pl&lt;/a&gt;&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientB/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientB/application.pl&lt;/a&gt;&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientX/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientX/application.pl&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; So the users of &amp;quot;clientA&amp;quot; log in to 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientA/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/application.pl&lt;/a&gt;&amp;nbsp;and are authenticated with 
&lt;br&gt;&amp;gt; Apache2::AuthCookieDBI
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Now the directories clientA, clientB, etc. do not exist, I'm using 
&lt;br&gt;&amp;gt; mod_rewrite to sort that out, and here starts my problems. &amp;nbsp;First I'm 
&lt;br&gt;&amp;gt; lost with authenticating since there's no &amp;quot;real&amp;quot; resource to 
&lt;br&gt;&amp;gt; authenticate against, but I seem to have solved that by forcing 
&lt;br&gt;&amp;gt; authentication against all *.pl files which luckily do exist ;)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; It gets more complicated later because some URLs like
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.site.com/clientA/iCal&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/iCal&lt;/a&gt;&amp;nbsp;can't use session cookies but have to 
&lt;br&gt;&amp;gt; use BASIC AUTH, and other *.pl files can't have any authentication 
&lt;br&gt;&amp;gt; applied against them.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I thought I could solve this by writing a MyAuthCookieDBI.pm but this 
&lt;br&gt;&amp;gt; also isn't working out. &amp;nbsp;For example MyAuthCookieDBI is an 
&lt;br&gt;&amp;gt; almost-empty child. &amp;nbsp;The parent (Apache2::AuthCookieDBI) has a 
&lt;br&gt;&amp;gt; function _dbi_connect() which manages all the database connecting, but 
&lt;br&gt;&amp;gt; I can't overwrite that function, even if MyAuthCookieDBI is the 
&lt;br&gt;&amp;gt; calling object the function from Apache2::AuthCookieDBI always gets 
&lt;br&gt;&amp;gt; called rather than the overridden function in my object.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; That's kind of the tip of things, basically I'm realizing that I need 
&lt;br&gt;&amp;gt; professional help with this task before I end up requiring 
&lt;br&gt;&amp;gt; professional help for my nerves!
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; So if anyone can help with this then please contact me offlist with 
&lt;br&gt;&amp;gt; terms.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks!
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Tosh
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/mod_perl-waters-too-deep-tp26779387p26779502.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26779387</id>
	<title>mod_perl waters too deep</title>
	<published>2009-12-14T07:14:31Z</published>
	<updated>2009-12-14T07:14:31Z</updated>
	<author>
		<name>Tosh Cooey-2</name>
	</author>
	<content type="html">You may have seen my other recent questions to the list this month, the 
&lt;br&gt;gist of which is:
&lt;br&gt;&lt;br&gt;I want to setup an application for multiple clients, each of whom have 
&lt;br&gt;their own users.
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.site.com/clientA/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/application.pl&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.site.com/clientB/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientB/application.pl&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.site.com/clientX/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientX/application.pl&lt;/a&gt;&lt;br&gt;&lt;br&gt;So the users of &amp;quot;clientA&amp;quot; log in to 
&lt;br&gt;&lt;a href=&quot;http://www.site.com/clientA/application.pl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/application.pl&lt;/a&gt;&amp;nbsp;and are authenticated with 
&lt;br&gt;Apache2::AuthCookieDBI
&lt;br&gt;&lt;br&gt;Now the directories clientA, clientB, etc. do not exist, I'm using 
&lt;br&gt;mod_rewrite to sort that out, and here starts my problems. &amp;nbsp;First I'm 
&lt;br&gt;lost with authenticating since there's no &amp;quot;real&amp;quot; resource to 
&lt;br&gt;authenticate against, but I seem to have solved that by forcing 
&lt;br&gt;authentication against all *.pl files which luckily do exist ;)
&lt;br&gt;&lt;br&gt;It gets more complicated later because some URLs like
&lt;br&gt;&lt;a href=&quot;http://www.site.com/clientA/iCal&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.site.com/clientA/iCal&lt;/a&gt;&amp;nbsp;can't use session cookies but have to 
&lt;br&gt;use BASIC AUTH, and other *.pl files can't have any authentication 
&lt;br&gt;applied against them.
&lt;br&gt;&lt;br&gt;I thought I could solve this by writing a MyAuthCookieDBI.pm but this 
&lt;br&gt;also isn't working out. &amp;nbsp;For example MyAuthCookieDBI is an almost-empty 
&lt;br&gt;child. &amp;nbsp;The parent (Apache2::AuthCookieDBI) has a function 
&lt;br&gt;_dbi_connect() which manages all the database connecting, but I can't 
&lt;br&gt;overwrite that function, even if MyAuthCookieDBI is the calling object 
&lt;br&gt;the function from Apache2::AuthCookieDBI always gets called rather than 
&lt;br&gt;the overridden function in my object.
&lt;br&gt;&lt;br&gt;That's kind of the tip of things, basically I'm realizing that I need 
&lt;br&gt;professional help with this task before I end up requiring professional 
&lt;br&gt;help for my nerves!
&lt;br&gt;&lt;br&gt;So if anyone can help with this then please contact me offlist with terms.
&lt;br&gt;&lt;br&gt;Thanks!
&lt;br&gt;&lt;br&gt;Tosh
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;McIntosh Cooey - Twelve Hundred Group LLC - &lt;a href=&quot;http://www.1200group.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.1200group.com/&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/mod_perl-waters-too-deep-tp26779387p26779387.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26772763</id>
	<title>Cron &lt;perlwww@minotaur&gt; /home/perlwww/apache.org/modperl-docs/bin/site_build_force_pdf_index</title>
	<published>2009-12-13T19:30:18Z</published>
	<updated>2009-12-13T19:30:18Z</updated>
	<author>
		<name>Cron Daemon-4</name>
	</author>
	<content type="html">&lt;br&gt;----------------------------------------
&lt;br&gt;File: /x1/home/perlwww/apache.org/modperl-docs/src/about/pronounce.pod
&lt;br&gt;spurious '&amp;gt;' at &amp;lt;input text&amp;gt; line 83
&lt;br&gt;spurious '&amp;gt;' at &amp;lt;input text&amp;gt; line 84
&lt;br&gt;&lt;br&gt;----------------------------------------
&lt;br&gt;File: /x1/home/perlwww/apache.org/modperl-docs/src/about/pronounce.pod
&lt;br&gt;spurious '&amp;gt;' at &amp;lt;input text&amp;gt; line 83
&lt;br&gt;spurious '&amp;gt;' at &amp;lt;input text&amp;gt; line 84
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26772763&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;docs-dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26772763&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;docs-dev-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---Docs---Dev-f188.html&quot; embed=&quot;fixTarget[188]&quot; target=&quot;_top&quot; &gt;mod_perl - Docs - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Cron-%3Cperlwww%40minotaur%3E--home-perlwww-apache.org-modperl-docs-bin-site_build_force_pdf_index-tp26772763p26772763.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26759104</id>
	<title>Re: [error] Software caused connection abort at</title>
	<published>2009-12-12T08:46:48Z</published>
	<updated>2009-12-12T08:46:48Z</updated>
	<author>
		<name>Cosimo Streppone</name>
	</author>
	<content type="html">In data 12 dicembre 2009 alle ore 05:38:06, discobeta &amp;nbsp;
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26759104&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;discobeta@...&lt;/a&gt;&amp;gt; ha scritto:
&lt;br&gt;&lt;br&gt;&amp;gt; Dear all,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Recently i've been noticing an error on the apache error log that
&lt;br&gt;&amp;gt; states:[error] Software caused connection abort at [script path] line &amp;nbsp;
&lt;br&gt;&amp;gt; [line
&lt;br&gt;&amp;gt; number].
&lt;br&gt;&lt;br&gt;I've seen that happen when I used something like:
&lt;br&gt;&lt;br&gt;sub handler {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;my ($r) = @_;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;# ...
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;my $response_body = whatever();
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;$r-&amp;gt;content_type('text/html');
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;$r-&amp;gt;print($response_body);
&lt;br&gt;&lt;br&gt;}
&lt;br&gt;&lt;br&gt;*AND*
&lt;br&gt;&lt;br&gt;for some weird reason, `$response_body' happened to be empty.
&lt;br&gt;&lt;br&gt;&amp;gt; Can anyone point me in the right direction?
&lt;br&gt;&lt;br&gt;I would start logging whatever you are trying
&lt;br&gt;to $r-&amp;gt;print().
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Cosimo
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-error--Software-caused-connection-abort-at-tp26754945p26759104.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26758753</id>
	<title>Re: avoiding child death by size limit</title>
	<published>2009-12-12T08:08:02Z</published>
	<updated>2009-12-12T08:08:02Z</updated>
	<author>
		<name>Torsten Foertsch</name>
	</author>
	<content type="html">On Saturday 12 December 2009 00:24:24 Perrin Harkins wrote:
&lt;br&gt;&amp;gt; Perl will keep the memory and reuse it for that exact same lexical
&lt;br&gt;&amp;gt; variable the next time you enter that section of code. &amp;nbsp;It's a
&lt;br&gt;&amp;gt; performance optimization that is usually a good thing, unless you put
&lt;br&gt;&amp;gt; a lot of data in one lexical in some code that you rarely run.
&lt;br&gt;&amp;gt; 
&lt;br&gt;perhaps an example can help to shed some light. To understand it you have to
&lt;br&gt;know that many malloc implementations allocate large chunks of memory via
&lt;br&gt;mmap() while smaller pieces are allocated via brk(). The mmap-allocated
&lt;br&gt;blocks can later be returned to the OS while the brk-allocated can not.
&lt;br&gt;&lt;br&gt;So, here is the example. It creates a large string (10 mbytes) and assigns it
&lt;br&gt;to the variable $x. This means another 10mb chunk is allocated to keep the
&lt;br&gt;variable. Devel::Peek::Dump is used to show the address of the string assigned
&lt;br&gt;to the variable.
&lt;br&gt;&lt;br&gt;Now look what is when freed:
&lt;br&gt;&lt;br&gt;strace perl -MDevel::Peek -e '{my $x=&amp;quot;x&amp;quot;x(10*1024*1024); $x=&amp;quot;&amp;quot;; Dump $x; undef $x; warn 1;} warn 2'
&lt;br&gt;&lt;br&gt;Here 2 memory blocks are allocated. One is the &amp;quot;x&amp;quot;x(10*1024*1024) string the
&lt;br&gt;other is the PV-member of $x. It seems to be logical that the second one is
&lt;br&gt;$x but let's see ...
&lt;br&gt;&lt;br&gt;mmap(NULL, 10489856, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff87f08a000
&lt;br&gt;mmap(NULL, 10489856, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff87e689000
&lt;br&gt;&lt;br&gt;These write()s come from Dump $x. The PV=0x7ff87e689028 line below is of
&lt;br&gt;particular interest. It shows that the memory block at 0x7ff87e689000
&lt;br&gt;in fact belongs to $x.
&lt;br&gt;&lt;br&gt;write(2, &amp;quot;SV = &amp;quot;, 5SV = ) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 5
&lt;br&gt;write(2, &amp;quot;PV(0x78bcb0) at 0x78ef78\n &amp;nbsp;REFCN&amp;quot;..., 65PV(0x78bcb0) at 0x78ef78
&lt;br&gt;&amp;nbsp; REFCNT = 1
&lt;br&gt;&amp;nbsp; FLAGS = (PADMY,POK,pPOK)
&lt;br&gt;) = 65
&lt;br&gt;write(2, &amp;quot; &amp;nbsp;PV = 0x7ff87e689028 &amp;quot;, 22 &amp;nbsp;PV = 0x7ff87e689028 ) &amp;nbsp;= 22
&lt;br&gt;write(2, &amp;quot;\&amp;quot;\&amp;quot;\\0&amp;quot;, 4&amp;quot;&amp;quot;\0) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 4
&lt;br&gt;write(2, &amp;quot;\n&amp;quot;, 1
&lt;br&gt;) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = 1
&lt;br&gt;write(2, &amp;quot; &amp;nbsp;CUR = 0\n&amp;quot;, 10 &amp;nbsp;CUR = 0
&lt;br&gt;) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = 10
&lt;br&gt;write(2, &amp;quot; &amp;nbsp;LEN = 10485768\n&amp;quot;, 17 &amp;nbsp;LEN = 10485768
&lt;br&gt;) &amp;nbsp; &amp;nbsp; &amp;nbsp;= 17
&lt;br&gt;&lt;br&gt;The next syscall comes from undef $x. Here the second allocated block is
&lt;br&gt;freed and returned to the OS.
&lt;br&gt;&lt;br&gt;munmap(0x7ff87e689000, 10489856) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 0
&lt;br&gt;&lt;br&gt;This write() is the &amp;quot;warn 1&amp;quot;
&lt;br&gt;&lt;br&gt;write(2, &amp;quot;1 at -e line 1.\n&amp;quot;, 161 at -e line 1.
&lt;br&gt;) &amp;nbsp; &amp;nbsp; &amp;nbsp; = 16
&lt;br&gt;&lt;br&gt;And this the &amp;quot;warn 2&amp;quot;. You see the memory block allocated to keep the
&lt;br&gt;&amp;quot;x&amp;quot;x(10*1024*1024) string is still kept by the program even though the
&lt;br&gt;scope where it has been allocated is finished.
&lt;br&gt;&lt;br&gt;write(2, &amp;quot;2 at -e line 1.\n&amp;quot;, 162 at -e line 1.
&lt;br&gt;) &amp;nbsp; &amp;nbsp; &amp;nbsp; = 16
&lt;br&gt;&lt;br&gt;Only right before finishing the program the &amp;quot;x&amp;quot;x(10*1024*1024) string
&lt;br&gt;is freed.
&lt;br&gt;&lt;br&gt;munmap(0x7ff87f08a000, 10489856) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 0
&lt;br&gt;exit_group(0) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = ?
&lt;br&gt;&lt;br&gt;&lt;br&gt;Now, omit the &amp;quot;undef $x&amp;quot; and see when the memory allocated to the variable
&lt;br&gt;is freed.
&lt;br&gt;&lt;br&gt;Torsten
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/avoiding-child-death-by-size-limit-tp26733134p26758753.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26755096</id>
	<title>Re: [error] Software caused connection abort at</title>
	<published>2009-12-11T21:17:34Z</published>
	<updated>2009-12-11T21:17:34Z</updated>
	<author>
		<name>Kurt Hansen-2</name>
	</author>
	<content type="html">discobeta wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Dear all,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Recently i've been noticing an error on the apache error log that 
&lt;br&gt;&amp;gt; states:[error] Software caused connection abort at [script path] line 
&lt;br&gt;&amp;gt; [line number].
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Subsequently, i've been noticing another error, :Apache IO flush: 
&lt;br&gt;&amp;gt; (103) Software caused connection abort at -e line 0
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Always fails upon printing to stdout.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Can anyone point me in the right direction?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks, Apache Server version: Apache/2.0.52 Server built: &amp;nbsp; Nov 11 
&lt;br&gt;&amp;gt; 2009 03:49:40 Platform: RHEL5 on a x86_64
&lt;/div&gt;I started having the same error about a week ago. I don't have any 
&lt;br&gt;answers, only questions. Here's an earlier thread on this:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://marc.info/?l=apache-modperl&amp;m=125879662802023&amp;w=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://marc.info/?l=apache-modperl&amp;m=125879662802023&amp;w=2&lt;/a&gt;&lt;br&gt;&lt;br&gt;I put the eval in as suggested and write it to my log -- I don't think 
&lt;br&gt;that fixes things though.
&lt;br&gt;&lt;br&gt;See my message from earlier today to describe my setup. I failed to 
&lt;br&gt;mention that I am on an x86_64 machine, too.
&lt;br&gt;&lt;br&gt;What version of mod_perl are you using? Do you use Apache::DBI? Version? 
&lt;br&gt;Apache2::Request?
&lt;br&gt;&lt;br&gt;Just looking for leads myself.
&lt;br&gt;&lt;br&gt;Take care,
&lt;br&gt;&lt;br&gt;Kurt Hansen
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26755096&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;khansen@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-error--Software-caused-connection-abort-at-tp26754945p26755096.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26754945</id>
	<title>[error] Software caused connection abort at</title>
	<published>2009-12-11T20:38:06Z</published>
	<updated>2009-12-11T20:38:06Z</updated>
	<author>
		<name>discobeta</name>
	</author>
	<content type="html">Dear all,&lt;br&gt;
&lt;br&gt;
Recently i&amp;#39;ve been noticing an error on the apache error log that
states:[error] Software caused connection abort at [script path] line
[line number].&lt;br&gt;
&lt;br&gt;
Subsequently, i&amp;#39;ve been noticing another error, :Apache IO flush: (103) Software caused connection abort at -e line 0&lt;br&gt;
&lt;br&gt;
Always fails upon printing to stdout.&lt;br&gt;
&lt;br&gt;
Can anyone point me in the right direction?&lt;br&gt;
&lt;br&gt;
Thanks,

Apache Server version: Apache/2.0.52 Server built:   Nov 11 2009 03:49:40
Platform: RHEL5 on a x86_64
&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-error--Software-caused-connection-abort-at-tp26754945p26754945.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26753028</id>
	<title>Re: avoiding child death by size limit</title>
	<published>2009-12-11T15:24:24Z</published>
	<updated>2009-12-11T15:24:24Z</updated>
	<author>
		<name>Perrin Harkins-3</name>
	</author>
	<content type="html">On Fri, Dec 11, 2009 at 5:56 PM, André Warnier &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26753028&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aw@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; When you say &amp;quot;It (perl) will keep the memory&amp;quot;, do you mean that
&lt;br&gt;&amp;gt; - the perl interpreter embedded in this Apache child will keep the memory
&lt;br&gt;&amp;gt; (and not return it to the OS), but will re-use it if possible for other
&lt;br&gt;&amp;gt; variable allocations happening within its lifetime ?
&lt;br&gt;&amp;gt; or
&lt;br&gt;&amp;gt; - the perl interpreter embedded in this Apache child will keep the memory
&lt;br&gt;&amp;gt; (and not return it to the OS), and never re-use it again for any other
&lt;br&gt;&amp;gt; variable allocation happening within its lifetime
&lt;br&gt;&amp;gt; (in other words, this is a leak) ?
&lt;br&gt;&lt;br&gt;Option 3:
&lt;br&gt;Perl will keep the memory and reuse it for that exact same lexical
&lt;br&gt;variable the next time you enter that section of code. &amp;nbsp;It's a
&lt;br&gt;performance optimization that is usually a good thing, unless you put
&lt;br&gt;a lot of data in one lexical in some code that you rarely run.
&lt;br&gt;&lt;br&gt;It's not a leak. &amp;nbsp;Perl tracks the memory and will reuse it, just not
&lt;br&gt;for any other variables.
&lt;br&gt;&lt;br&gt;&amp;gt; Does any guru care to provide some simple real-world examples of when memory
&lt;br&gt;&amp;gt; once allocated to a variable is/is not being re-used, in a mod_perl handler
&lt;br&gt;&amp;gt; context ?
&lt;br&gt;&lt;br&gt;It's simple to see. &amp;nbsp;Slurp a file into a lexical. &amp;nbsp;Let it go out of
&lt;br&gt;scope. &amp;nbsp;There are many posts on this subject in the archives here as
&lt;br&gt;well as on PerlMonks and the p5p archives.
&lt;br&gt;&lt;br&gt;&amp;gt; Maybe on this last subject, what I gather from this and other discussions
&lt;br&gt;&amp;gt; I've seen, is that once the Perl interpreter obtained some memory from the
&lt;br&gt;&amp;gt; OS, it rarely returns it (before it exits); and if it does, it is in any
&lt;br&gt;&amp;gt; case not practically predictable in a cross-platform way, so one cannot rely
&lt;br&gt;&amp;gt; on it.  Is that a fair interpretation ?
&lt;br&gt;&lt;br&gt;Yes, you can't expect to get memory back.
&lt;br&gt;&lt;br&gt;- Perrin
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/avoiding-child-death-by-size-limit-tp26733134p26753028.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26752745</id>
	<title>Re: avoiding child death by size limit</title>
	<published>2009-12-11T14:56:32Z</published>
	<updated>2009-12-11T14:56:32Z</updated>
	<author>
		<name>awarnier</name>
	</author>
	<content type="html">Perrin Harkins wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Fri, Dec 11, 2009 at 11:37 AM, William T &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26752745&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dietbuddha@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt; You can make sure the variables that the memory was malloc'd for have
&lt;br&gt;&amp;gt;&amp;gt; gone out of scope, and there are not trailing references to them.
&lt;br&gt;&amp;gt;&amp;gt; Perl will then reuse that memory.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; It will keep the memory allocated to the out-of-scope variables unless
&lt;br&gt;&amp;gt; you undef them.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; There's a summary of many PerlMonks discussions on this topic here:
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.perlmonks.org/?node_id=803515&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.perlmonks.org/?node_id=803515&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;/div&gt;Perrin,
&lt;br&gt;that is in the end, in my personal opinion, a rather confusing discussion.
&lt;br&gt;&lt;br&gt;So, to an extent, is your phrase above.
&lt;br&gt;When you say &amp;quot;It (perl) will keep the memory&amp;quot;, do you mean that
&lt;br&gt;- the perl interpreter embedded in this Apache child will keep the 
&lt;br&gt;memory (and not return it to the OS), but will re-use it if possible for 
&lt;br&gt;other variable allocations happening within its lifetime ?
&lt;br&gt;or
&lt;br&gt;- the perl interpreter embedded in this Apache child will keep the 
&lt;br&gt;memory (and not return it to the OS), and never re-use it again for any 
&lt;br&gt;other variable allocation happening within its lifetime
&lt;br&gt;(in other words, this is a leak) ?
&lt;br&gt;&lt;br&gt;Does any guru care to provide some simple real-world examples of when 
&lt;br&gt;memory once allocated to a variable is/is not being re-used, in a 
&lt;br&gt;mod_perl handler context ?
&lt;br&gt;Or pointers to ditto ?
&lt;br&gt;(Maybe at first independently of whether the memory also may, or not, be 
&lt;br&gt;returned by Perl to the OS)
&lt;br&gt;&lt;br&gt;Maybe on this last subject, what I gather from this and other 
&lt;br&gt;discussions I've seen, is that once the Perl interpreter obtained some 
&lt;br&gt;memory from the OS, it rarely returns it (before it exits); and if it 
&lt;br&gt;does, it is in any case not practically predictable in a cross-platform 
&lt;br&gt;way, so one cannot rely on it. &amp;nbsp;Is that a fair interpretation ?
&lt;br&gt;&lt;br&gt;&lt;br&gt;Would it be preferable/easier if I construct some simple examples myself 
&lt;br&gt;and present them here asking if memory allocated to &amp;quot;my $a&amp;quot; is being 
&lt;br&gt;leaked or not ?
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/avoiding-child-death-by-size-limit-tp26733134p26752745.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26752050</id>
	<title>Re: avoiding child death by size limit</title>
	<published>2009-12-11T13:59:41Z</published>
	<updated>2009-12-11T13:59:41Z</updated>
	<author>
		<name>Perrin Harkins-3</name>
	</author>
	<content type="html">On Fri, Dec 11, 2009 at 11:37 AM, William T &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26752050&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dietbuddha@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; You can make sure the variables that the memory was malloc'd for have
&lt;br&gt;&amp;gt; gone out of scope, and there are not trailing references to them.
&lt;br&gt;&amp;gt; Perl will then reuse that memory.
&lt;br&gt;&lt;br&gt;It will keep the memory allocated to the out-of-scope variables unless
&lt;br&gt;you undef them.
&lt;br&gt;&lt;br&gt;There's a summary of many PerlMonks discussions on this topic here:
&lt;br&gt;&lt;a href=&quot;http://www.perlmonks.org/?node_id=803515&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.perlmonks.org/?node_id=803515&lt;/a&gt;&lt;br&gt;&lt;br&gt;- Perrin
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/avoiding-child-death-by-size-limit-tp26733134p26752050.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26751320</id>
	<title>Re: avoiding child death by size limit</title>
	<published>2009-12-11T12:54:55Z</published>
	<updated>2009-12-11T12:54:55Z</updated>
	<author>
		<name>awarnier</name>
	</author>
	<content type="html">E R wrote:
&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I have a problem where a mod_perl handler will allocate a lot of
&lt;br&gt;&amp;gt; memory when processing a request, and this causes Apache to kill the
&lt;br&gt;&amp;gt; child due to exceeding the configure child size limit.
&lt;br&gt;&lt;br&gt;Chances are that a child does not exceed this memory right away, at the 
&lt;br&gt;first request. &amp;nbsp;More likely, it uses more and more memory at each 
&lt;br&gt;request it processes, and finally after a number of requests, it exceeds 
&lt;br&gt;the maximum memory and gets killed.
&lt;br&gt;In other words, it is leaking.
&lt;br&gt;&lt;br&gt;So, paraphrasing someone else : don't treat the symptom, treat the cause.
&lt;br&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; However, the memory allocated will get freed up or re-used by the next
&lt;br&gt;&amp;gt; request - 
&lt;br&gt;&lt;br&gt;If it is a real leak, then no, it will not.
&lt;br&gt;&lt;br&gt;I think the memory is just fragmented enough to be
&lt;br&gt;&amp;gt; automatically reclaimed by the memory allocator (I've heard that some
&lt;br&gt;&amp;gt; mallocs can return memory to the OS in 1 MB chunks.)
&lt;br&gt;&lt;br&gt;See William's answer : unlikely.
&lt;br&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Are there any special techniques people use to avoid this situation?
&lt;br&gt;&amp;gt; Does SizeLimit count actual memory used or does it just look at the
&lt;br&gt;&amp;gt; process size?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&lt;br&gt;In a previous similar exercise, in despair I used the module Devel::Leak 
&lt;br&gt;as follows :
&lt;br&gt;&lt;br&gt;use Devel::Leak;
&lt;br&gt;my $DEBUGMem = 1;
&lt;br&gt;my ($SVTable,$prevSVCount,$lastSVCount);
&lt;br&gt;&lt;br&gt;if ($DEBUGMem) {
&lt;br&gt;&amp;nbsp; &amp;nbsp;$prevSVCount = Devel::Leak::NoteSV($SVTable);
&lt;br&gt;&amp;nbsp; &amp;nbsp;warn &amp;quot;[$$] before something, total SVs : $prevSVCount&amp;quot;;
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;do_something(); # .. which could be leaking
&lt;br&gt;&lt;br&gt;if ($DEBUGMem) {
&lt;br&gt;&amp;nbsp; &amp;nbsp;$lastSVCount = Devel::Leak::CheckSV($SVTable);
&lt;br&gt;&amp;nbsp; &amp;nbsp;warn &amp;quot;[$$] after something : total SVs : $lastSVCount&amp;quot;;
&lt;br&gt;&amp;nbsp; &amp;nbsp;warn &amp;quot;[$$] &amp;nbsp; new SVs : &amp;quot;,($lastSVCount - $prevSVCount);
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;It doesn't require any specially-compiled perl.
&lt;br&gt;It does not actually print the memory size used. &amp;nbsp;It just provides a 
&lt;br&gt;count of new &amp;quot;things&amp;quot; that have been allocated and not freed by 
&lt;br&gt;do_something(). It is very rough, but it was very helpful to me to find 
&lt;br&gt;out what exact piece of code was leaking &amp;quot;things&amp;quot;, which is basically an 
&lt;br&gt;alias for memory.
&lt;br&gt;The point is, if it keeps on growing around the same piece of code each 
&lt;br&gt;time you process a request, then you at least know where bad things happen.
&lt;br&gt;&lt;br&gt;If it happens in your code, then when you know where, it should be 
&lt;br&gt;possible to fix it. &amp;nbsp;If it happens in someone else's module that you are 
&lt;br&gt;using, there are usually several alternative modules for just about 
&lt;br&gt;anything on CPAN. &amp;nbsp;If there aren't and you cannot do without, /then/ 
&lt;br&gt;maybe you should considering limiting the number of requests that each 
&lt;br&gt;child handles before it gets killed. But that should not be the first 
&lt;br&gt;choice, because it is the least efficient.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/avoiding-child-death-by-size-limit-tp26733134p26751320.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26749979</id>
	<title>Re: AW: print throwing intermittent Segfaults</title>
	<published>2009-12-11T11:08:44Z</published>
	<updated>2009-12-11T11:08:44Z</updated>
	<author>
		<name>Kurt Hansen-2</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;I started to see the following when I setup a new server on CentOS 5.4 
&lt;br&gt;and installed perl modules from CPAN on Dec. 4:
&lt;br&gt;&lt;br&gt;Denis Banovic wrote:
&lt;br&gt;&amp;gt; This is from the error_log from the RedHat 5 Production machine:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Apache2::RequestIO::print: (103) Software caused connection abort at 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The guys from rackspace are saying that I should recompile all my perl modules installed directly from CPAN ( see above ) , do you think this would help?
&lt;br&gt;&amp;gt; Or has someone another hint?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;I do not see this on another server with CentOS 5.2 and perl modules 
&lt;br&gt;primarily built Feb 09.
&lt;br&gt;&lt;br&gt;I think something has changed in either CentOS, Apache, or the perl 
&lt;br&gt;modules I use in the interim.
&lt;br&gt;&lt;br&gt;I think it has something to do with Apache children being killed either 
&lt;br&gt;because of size or request limit reached.
&lt;br&gt;&lt;br&gt;So, Denis, have you tried adjusting these:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;gt;From my Apache Config:
&lt;br&gt;&amp;gt; &amp;lt;IfModule prefork.c&amp;gt;
&lt;br&gt;&amp;gt; StartServers &amp;nbsp; &amp;nbsp; &amp;nbsp; 8
&lt;br&gt;&amp;gt; MinSpareServers &amp;nbsp; &amp;nbsp;5
&lt;br&gt;&amp;gt; MaxSpareServers &amp;nbsp; 20
&lt;br&gt;&amp;gt; ServerLimit &amp;nbsp; &amp;nbsp; &amp;nbsp;256
&lt;br&gt;&amp;gt; MaxClients &amp;nbsp; &amp;nbsp; &amp;nbsp; 200
&lt;br&gt;&amp;gt; MaxRequestsPerChild &amp;nbsp;15
&lt;br&gt;&amp;gt; &amp;lt;/IfModule&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;/div&gt;The MaxRequetsPerChild especially seems awfully small.
&lt;br&gt;&lt;br&gt;Plus, you say you see the problem happening every 30 to 250 requests. 
&lt;br&gt;(StartServers)8 * (MaxRequestsPerChild)15 = 120. This sounds like 
&lt;br&gt;roughtly around the time you'd expect Apache children to die.
&lt;br&gt;&lt;br&gt;I had MaxRequests set at 2000 and saw the problem intermittently. I'm 
&lt;br&gt;going to set MaxRequests to 0 to turn it off and see if it goes away.
&lt;br&gt;&lt;br&gt;I wonder if something has changed in Apache recently? Or, mod_perl?
&lt;br&gt;&lt;br&gt;Both servers are running Apache 2.2.3. One is running mod_perl 2.0.2 and 
&lt;br&gt;the other one is 2.0.4. Judging on the version numbers...could this be a 
&lt;br&gt;bug in 2.0.4?
&lt;br&gt;&lt;br&gt;Take care,
&lt;br&gt;&lt;br&gt;Kurt Hansen
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/print-throwing-intermittent-Segfaults-tp26455010p26749979.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26748191</id>
	<title>bytes malloc-ed less bytes free-ed</title>
	<published>2009-12-11T09:17:44Z</published>
	<updated>2009-12-11T09:17:44Z</updated>
	<author>
		<name>jscripter</name>
	</author>
	<content type="html">as kind of a followup to my last question...
&lt;br&gt;&lt;br&gt;is there a way to determine this quantity: the amount of memory
&lt;br&gt;malloc-ed minus the amount of memory free-ed? It seems that this would
&lt;br&gt;be easy for malloc()/free() to keep track of.
&lt;br&gt;&lt;br&gt;I would like to compare that value with the process size to get an
&lt;br&gt;idea of how much memory my program needs vs. how much it is actually
&lt;br&gt;taking up.
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;&lt;br&gt;ER
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/bytes-malloc-ed-less-bytes-free-ed-tp26748191p26748191.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26747456</id>
	<title>Re: avoiding child death by size limit</title>
	<published>2009-12-11T08:37:31Z</published>
	<updated>2009-12-11T08:37:31Z</updated>
	<author>
		<name>William T</name>
	</author>
	<content type="html">On Thu, Dec 10, 2009 at 11:28 AM, E R &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26747456&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;pc88mxer@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I have a problem where a mod_perl handler will allocate a lot of
&lt;br&gt;&amp;gt; memory when processing a request, and this causes Apache to kill the
&lt;br&gt;&amp;gt; child due to exceeding the configure child size limit.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Are there any special techniques people use to avoid this situation?
&lt;br&gt;&amp;gt; Does SizeLimit count actual memory used or does it just look at the
&lt;br&gt;&amp;gt; process size?
&lt;br&gt;&lt;br&gt;You can make sure the variables that the memory was malloc'd for have
&lt;br&gt;gone out of scope, and there are not trailing references to them.
&lt;br&gt;Perl will then reuse that memory. &amp;nbsp;Occasionaly Perl will free memory
&lt;br&gt;it's not using, but why, where and when can be hard to determine.
&lt;br&gt;It's not always as clear cut as undef'ing the variable.
&lt;br&gt;&lt;br&gt;In terms of managing memory in your mod_perl process you can use any
&lt;br&gt;of the standard techniques:
&lt;br&gt;&lt;br&gt;&amp;nbsp; * change/fix the code (fix memory leak, Tie structure to filesystem/db, ...)
&lt;br&gt;&amp;nbsp; * recycle your children after N number of request are completed
&lt;br&gt;&amp;nbsp; * offload the memory intensive work into a different process space
&lt;br&gt;(another instance of Apache/mod_perl or even just Perl)
&lt;br&gt;&amp;nbsp; * use a system set resource limit (not so good because it can kill
&lt;br&gt;the proc mid-request)
&lt;br&gt;&amp;nbsp; * Apache2::SizeLimit (kill the proc after it's done serving the
&lt;br&gt;request when it grows too big)
&lt;br&gt;&lt;br&gt;These were off the top of my head. &amp;nbsp;THere may be other techniques I missed.
&lt;br&gt;&lt;br&gt;-wjt
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/avoiding-child-death-by-size-limit-tp26733134p26747456.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26736992</id>
	<title>Re: Detecting graceful restart/stop in child processes</title>
	<published>2009-12-10T16:41:39Z</published>
	<updated>2009-12-10T16:41:39Z</updated>
	<author>
		<name>Bill Moseley</name>
	</author>
	<content type="html">&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Mon, Dec 7, 2009 at 7:01 AM, Bill Moseley &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26736992&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;moseley@...&lt;/a&gt;&amp;gt;&lt;/span&gt;\&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;

&lt;div class=&quot;gmail_quote&quot;&gt;&lt;div&gt;&lt;br&gt;So, it would be more convenient if a graceful restart could be done on just Apache and that would trigger closing the connections on the next response freeing up the process to exit.  That&amp;#39;s the part I&amp;#39;m trying to get working.&lt;br&gt;

&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;This was pretty trivial once I remembered a little XS.&lt;br&gt;&lt;br&gt;One interesting thing I realized (which makes sense if you think about it) is that  MaxRequestsPerChild is not &amp;quot;requests&amp;quot; but connections.  IIRC, the parent has to track the request count and it only knows about connections.  So, with persistent connections you don&amp;#39;t really know the number of requests.  And with memory leaks it&amp;#39;s probably the requests that I&amp;#39;m interested in.&lt;br&gt;

&lt;br&gt;I suppose I could count requests in the application process and call child_terminate.  Or use Apache2::SizeLimit as that&amp;#39;s really the reason to limit number of requests.&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt; &lt;/div&gt;&lt;/div&gt;&lt;br&gt;-- &lt;br&gt;
Bill Moseley&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26736992&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;moseley@...&lt;/a&gt;&lt;br&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Detecting-graceful-restart-stop-in-child-processes-tp26667107p26736992.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26734478</id>
	<title>Re: avoiding child death by size limit</title>
	<published>2009-12-10T13:02:31Z</published>
	<updated>2009-12-10T13:02:31Z</updated>
	<author>
		<name>awarnier</name>
	</author>
	<content type="html">E R wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I have a problem where a mod_perl handler will allocate a lot of
&lt;br&gt;&amp;gt; memory when processing a request, and this causes Apache to kill the
&lt;br&gt;&amp;gt; child due to exceeding the configure child size limit.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; However, the memory allocated will get freed up or re-used by the next
&lt;br&gt;&amp;gt; request - I think the memory is just fragmented enough to be
&lt;br&gt;&amp;gt; automatically reclaimed by the memory allocator (I've heard that some
&lt;br&gt;&amp;gt; mallocs can return memory to the OS in 1 MB chunks.)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Are there any special techniques people use to avoid this situation?
&lt;br&gt;&amp;gt; Does SizeLimit count actual memory used or does it just look at the
&lt;br&gt;&amp;gt; process size?
&lt;br&gt;&amp;gt; 
&lt;/div&gt;This is not a direct answer to your question, and it begs for a more 
&lt;br&gt;authoritative answer.
&lt;br&gt;&lt;br&gt;I have had problems similar to yours, which I solved by turning what was 
&lt;br&gt;original part of my mod_perl handler (or script), into a separate 
&lt;br&gt;process. &amp;nbsp;I know it is not elegant, but it seems to work well in my case.
&lt;br&gt;One of the problems is that, as far as I know, once perl has obtained 
&lt;br&gt;some memory from the OS, it will never give it back until perl itself 
&lt;br&gt;exits. &amp;nbsp;And since by definition with mod_perl normally the perl 
&lt;br&gt;interpreter lives as long as the Apache process it is inside of, that 
&lt;br&gt;means almost never.
&lt;br&gt;But if perl runs as an external process for a request, then of course it 
&lt;br&gt;exits at the end of it, and the memory is returned.
&lt;br&gt;&lt;br&gt;The exact problem I had, was that some processing I had to do involved 
&lt;br&gt;parsing XML, and some XML parsing module in the chain (XML::Twig ?) was 
&lt;br&gt;leaking a chunk of memory at each request. I ended up with 
&lt;br&gt;multi-megabyte Apache children all the time.
&lt;br&gt;So I off-loaded this parsing into a separate process, which wrote (to 
&lt;br&gt;disk) its results in the form of a Storable structure. &amp;nbsp;When the 
&lt;br&gt;external process was done, the main mod_perl handler sucked in the data 
&lt;br&gt;back from the Storable file and deleted it.
&lt;br&gt;Not elegant, but it's been working flawlessly for several years now.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/avoiding-child-death-by-size-limit-tp26733134p26734478.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26734469</id>
	<title>Re: avoiding child death by size limit</title>
	<published>2009-12-10T13:02:20Z</published>
	<updated>2009-12-10T13:02:20Z</updated>
	<author>
		<name>Perrin Harkins-3</name>
	</author>
	<content type="html">On Thu, Dec 10, 2009 at 2:28 PM, E R &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26734469&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;pc88mxer@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; However, the memory allocated will get freed up or re-used by the next
&lt;br&gt;&amp;gt; request
&lt;br&gt;&lt;br&gt;The memory won't get freed unless you undef all the variables
&lt;br&gt;manually. &amp;nbsp;Perl keeps that memory otherwise, even when they go out of
&lt;br&gt;scope.
&lt;br&gt;&lt;br&gt;If you know it will get reused on the next request, then set your size
&lt;br&gt;limit higher.
&lt;br&gt;&lt;br&gt;If it's only being used for the current request and the odds of reuse
&lt;br&gt;on the following requests is low, the best thing is to kill the
&lt;br&gt;process as SizeLimit is doing.
&lt;br&gt;&lt;br&gt;- Perrin
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/avoiding-child-death-by-size-limit-tp26733134p26734469.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26733134</id>
	<title>avoiding child death by size limit</title>
	<published>2009-12-10T11:28:14Z</published>
	<updated>2009-12-10T11:28:14Z</updated>
	<author>
		<name>jscripter</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;I have a problem where a mod_perl handler will allocate a lot of
&lt;br&gt;memory when processing a request, and this causes Apache to kill the
&lt;br&gt;child due to exceeding the configure child size limit.
&lt;br&gt;&lt;br&gt;However, the memory allocated will get freed up or re-used by the next
&lt;br&gt;request - I think the memory is just fragmented enough to be
&lt;br&gt;automatically reclaimed by the memory allocator (I've heard that some
&lt;br&gt;mallocs can return memory to the OS in 1 MB chunks.)
&lt;br&gt;&lt;br&gt;Are there any special techniques people use to avoid this situation?
&lt;br&gt;Does SizeLimit count actual memory used or does it just look at the
&lt;br&gt;process size?
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;ER
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/avoiding-child-death-by-size-limit-tp26733134p26733134.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26705586</id>
	<title>Building CPAN/ppm modules on 64bit Windows</title>
	<published>2009-12-08T22:00:22Z</published>
	<updated>2009-12-08T22:00:22Z</updated>
	<author>
		<name>trillich</name>
	</author>
	<content type="html">Newbie question here -- this isn't mod_perl specific but the lists
&lt;br&gt;I've found that seem more appropriate have not-so-much traffic, and
&lt;br&gt;we're in a bit of a bind...
&lt;br&gt;&lt;br&gt;How do we build CPAN libraries on Win64?
&lt;br&gt;&lt;br&gt;&lt;br&gt;We've been building a bridge-module to migrate data from SIS
&lt;br&gt;(registrar data such as courses, instructors, students) into an LMS
&lt;br&gt;and back (as grades). We've got Win32::GUI to handle the interface of
&lt;br&gt;course... It works fin on our little 32-bit workstations, but the
&lt;br&gt;client has 64-bit windows on their server.
&lt;br&gt;&lt;br&gt;Nmake works on win32, but not on wni64. Dmake is recommended instead,
&lt;br&gt;but it's only available in C-code source, and we don't have any C
&lt;br&gt;compiler at hand. We're just looking to install a few perl modules,
&lt;br&gt;argh!
&lt;br&gt;&lt;br&gt;Is there another way to get CPAN/PPM (activestate's
&lt;br&gt;perl-package-manager) to build and install modules? Or does someone
&lt;br&gt;have a compiled DMAKE we could try?
&lt;br&gt;&lt;br&gt;Thanks bunches, mod-perlers!
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;will trillich
&lt;br&gt;&amp;quot;Tis the set of the sails / And not the gales / That tells the way we
&lt;br&gt;go.&amp;quot; -- Ella Wheeler Wilcox
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Building-CPAN-ppm-modules-on-64bit-Windows-tp26705586p26705586.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26701875</id>
	<title>Re: Subclassing Apache::AuthDBI</title>
	<published>2009-12-08T14:19:37Z</published>
	<updated>2009-12-08T14:19:37Z</updated>
	<author>
		<name>Tosh Cooey-2</name>
	</author>
	<content type="html">I'm enjoying talking to myself here all month! &amp;nbsp;So the solution to my 
&lt;br&gt;problem below...
&lt;br&gt;&lt;br&gt;Yay to MidLifeXis on PerlMonks for pointing out the problem.
&lt;br&gt;&lt;br&gt;When MyAuthDBI::authen is called then PERL looks to that specific object 
&lt;br&gt;for the function rather than traversing up the parent tree. 
&lt;br&gt;MyAuthDBI-&amp;gt;authen would call the function but the original 
&lt;br&gt;Apache::AuthDBI::authen expects $r as the first argument and not $self 
&lt;br&gt;and so a new set of problems arises.
&lt;br&gt;&lt;br&gt;So the easy solution to this problem is:
&lt;br&gt;&lt;br&gt;package MyAuthDBI;
&lt;br&gt;use base &amp;quot;Apache::AuthDBI&amp;quot;;
&lt;br&gt;sub authen {
&lt;br&gt;&amp;nbsp; &amp;nbsp;my ($r) = @_;
&lt;br&gt;&amp;nbsp; &amp;nbsp;Apache::AuthDBI::authen($r);
&lt;br&gt;}
&lt;br&gt;1;
&lt;br&gt;&lt;br&gt;To answer my final question, yes I was doing something glaringly dumb :)
&lt;br&gt;&lt;br&gt;Tosh
&lt;br&gt;&lt;br&gt;&lt;br&gt;Tosh Cooey wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I'm trying to subclass Apache::AuthDBI by doing:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; package MyAuthDBI;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; use base &amp;quot;Apache::AuthDBI&amp;quot;;
&lt;br&gt;&amp;gt; 1;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Then in apache.conf
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; PerlModule MyAuthDBI
&lt;br&gt;&amp;gt; &amp;lt;Location /test&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; AuthType Basic
&lt;br&gt;&amp;gt; &amp;nbsp; PerlAuthenHandler MyAuthDBI::authen
&lt;br&gt;&amp;gt; ...
&lt;br&gt;&amp;gt; &amp;lt;/Location&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I'm getting the following error:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; ...failed to resolve handler `MyAuthDBI::authen': Can't locate 
&lt;br&gt;&amp;gt; MyAuthDBI/authen.pm in @INC...
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Which kinda makes sense as an error message since the handler is 
&lt;br&gt;&amp;gt; declared MyAuthDBI::authen and not MyAuthDBI-&amp;gt;authen and yet it works 
&lt;br&gt;&amp;gt; just fine if I allow Apache::AuthDBI to handle the Authen.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Is it non trivial to subclass Apache::AuthDBI? &amp;nbsp;Am I doing something 
&lt;br&gt;&amp;gt; glaringly dumb?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thanks again...
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Tosh
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;McIntosh Cooey - Twelve Hundred Group LLC - &lt;a href=&quot;http://www.1200group.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.1200group.com/&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Subclassing-Apache%3A%3AAuthDBI-tp26671493p26701875.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26682887</id>
	<title>Fwd: &lt;Ref682782&gt; AFNIC / ACCUSE RECEPTION MAIL</title>
	<published>2009-12-07T11:40:54Z</published>
	<updated>2009-12-07T11:40:54Z</updated>
	<author>
		<name>Fred Moyer</name>
	</author>
	<content type="html">Help! :) &amp;nbsp;Let's get this guy off the list :)
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------- Forwarded message ----------
&lt;br&gt;From: &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26682887&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;support@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Mon, Dec 7, 2009 at 11:39 AM
&lt;br&gt;Subject: &amp;lt;Ref682782&amp;gt; AFNIC / ACCUSE RECEPTION MAIL
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26682887&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;fred@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;Bonjour,
&lt;br&gt;&lt;br&gt;Votre courriel &amp;quot;Fwd: svn commit: r888069 -
&lt;br&gt;/perl/modperl/docs/trunk/src/about/pronounce.pod&amp;quot; a bien été reçu par
&lt;br&gt;le support de l'AFNIC et porte le numéro 682782. Il fera l'objet d'un
&lt;br&gt;traitement dès que possible.
&lt;br&gt;&lt;br&gt;Dans l'intervalle, nous vous invitons à consulter notre FAQ et les
&lt;br&gt;actualités des opérations à l'AFNIC :
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.afnic.fr/doc/faq&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.afnic.fr/doc/faq&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.afnic.fr/operations&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.afnic.fr/operations&lt;/a&gt;&lt;br&gt;&lt;br&gt;Cordialement,
&lt;br&gt;----------
&lt;br&gt;Hello,
&lt;br&gt;&lt;br&gt;AFNIC support has received your message &amp;quot;Fwd: svn commit: r888069 -
&lt;br&gt;/perl/modperl/docs/trunk/src/about/pronounce.pod&amp;quot;. We will handle it
&lt;br&gt;as soon as possible.
&lt;br&gt;&lt;br&gt;Regards.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;Sujet : Fwd: svn commit: r888069 -
&lt;br&gt;/perl/modperl/docs/trunk/src/about/pronounce.pod
&lt;br&gt;N° dossier : 682782
&lt;br&gt;Corps du mail : Just committed this to hopefully kill the warnings we
&lt;br&gt;have been getting.
&lt;br&gt;&lt;br&gt;Thanks to Randy for the great suggestion.
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------- Forwarded message ----------
&lt;br&gt;From:  &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26682887&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;phred@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Mon, Dec 7, 2009 at 10:34 AM
&lt;br&gt;Subject: svn commit: r888069 - /perl/modperl/docs/trunk/src/about/pronounce.pod
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26682887&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;docs-cvs@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;Author: phred
&lt;br&gt;Date: Mon Dec  7 18:34:32 2009
&lt;br&gt;New Revision: 888069
&lt;br&gt;&lt;br&gt;URL: &lt;a href=&quot;http://svn.apache.org/viewvc?rev=888069&amp;view=rev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://svn.apache.org/viewvc?rev=888069&amp;view=rev&lt;/a&gt;&lt;br&gt;Log:
&lt;br&gt;Remove blank line which may be causing &amp;quot;spurious '&amp;gt;'&amp;quot; error.
&lt;br&gt;&lt;br&gt;Modified:
&lt;br&gt;   perl/modperl/docs/trunk/src/about/pronounce.pod
&lt;br&gt;&lt;br&gt;Modified: perl/modperl/docs/trunk/src/about/pronounce.pod
&lt;br&gt;URL: &lt;a href=&quot;http://svn.apache.org/viewvc/perl/modperl/docs/trunk/src/about/pronounce.pod?rev=888069&amp;r1=888068&amp;r2=888069&amp;view=diff&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://svn.apache.org/viewvc/perl/modperl/docs/trunk/src/about/pronounce.pod?rev=888069&amp;r1=888068&amp;r2=888069&amp;view=diff&lt;/a&gt;&lt;br&gt;==============================================================================
&lt;br&gt;--- perl/modperl/docs/trunk/src/about/pronounce.pod (original)
&lt;br&gt;+++ perl/modperl/docs/trunk/src/about/pronounce.pod Mon Dec  7 18:34:32 2009
&lt;br&gt;@@ -79,7 +79,6 @@
&lt;br&gt;        &amp;lt;td class=&amp;quot;table-bg&amp;quot;&amp;gt;
&lt;br&gt;                &amp;lt;a href=&amp;quot;pronounce/pereinar.ogg&amp;quot;&amp;gt;Listen&amp;lt;/a&amp;gt;
&lt;br&gt;        &amp;lt;/td&amp;gt;
&lt;br&gt;-
&lt;br&gt; &amp;lt;/tr&amp;gt;
&lt;br&gt; &amp;lt;/table&amp;gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26682887&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;docs-cvs-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26682887&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;docs-cvs-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26682887&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26682887&amp;i=7&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;NOUVEAU: Foire aux Questions (FAQ) dédiée aux Bureaux d'enregistrement AFNIC
&lt;br&gt;&lt;a href=&quot;http://operations.afnic.fr/fr/faq&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://operations.afnic.fr/fr/faq&lt;/a&gt;&lt;br&gt;&lt;br&gt;--
&lt;br&gt;&lt;br&gt;Pensez-y : toute l'actualité des opérations de l'Afnic est sur
&lt;br&gt;&lt;a href=&quot;http://operations.afnic.fr/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://operations.afnic.fr/&lt;/a&gt;&lt;br&gt;Support Afnic
&lt;br&gt;Tel: +33 1 39 30 83 00
&lt;br&gt;Fax: +33 1 39 30 83 83
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26682887&amp;i=8&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;support@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26682887&amp;i=9&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26682887&amp;i=10&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---Dev-f187.html&quot; embed=&quot;fixTarget[187]&quot; target=&quot;_top&quot; &gt;mod_perl - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Fwd%3A-%3CRef682782%3E-AFNIC---ACCUSE-RECEPTION-MAIL-tp26682887p26682887.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26682466</id>
	<title>Fwd: svn commit: r888069 - /perl/modperl/docs/trunk/src/about/pronounce.pod</title>
	<published>2009-12-07T11:12:05Z</published>
	<updated>2009-12-07T11:12:05Z</updated>
	<author>
		<name>Fred Moyer</name>
	</author>
	<content type="html">Just committed this to hopefully kill the warnings we have been getting.
&lt;br&gt;&lt;br&gt;Thanks to Randy for the great suggestion.
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------- Forwarded message ----------
&lt;br&gt;From: &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26682466&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;phred@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Mon, Dec 7, 2009 at 10:34 AM
&lt;br&gt;Subject: svn commit: r888069 - /perl/modperl/docs/trunk/src/about/pronounce.pod
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26682466&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;docs-cvs@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;Author: phred
&lt;br&gt;Date: Mon Dec  7 18:34:32 2009
&lt;br&gt;New Revision: 888069
&lt;br&gt;&lt;br&gt;URL: &lt;a href=&quot;http://svn.apache.org/viewvc?rev=888069&amp;view=rev&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://svn.apache.org/viewvc?rev=888069&amp;view=rev&lt;/a&gt;&lt;br&gt;Log:
&lt;br&gt;Remove blank line which may be causing &amp;quot;spurious '&amp;gt;'&amp;quot; error.
&lt;br&gt;&lt;br&gt;Modified:
&lt;br&gt;   perl/modperl/docs/trunk/src/about/pronounce.pod
&lt;br&gt;&lt;br&gt;Modified: perl/modperl/docs/trunk/src/about/pronounce.pod
&lt;br&gt;URL: &lt;a href=&quot;http://svn.apache.org/viewvc/perl/modperl/docs/trunk/src/about/pronounce.pod?rev=888069&amp;r1=888068&amp;r2=888069&amp;view=diff&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://svn.apache.org/viewvc/perl/modperl/docs/trunk/src/about/pronounce.pod?rev=888069&amp;r1=888068&amp;r2=888069&amp;view=diff&lt;/a&gt;&lt;br&gt;==============================================================================
&lt;br&gt;--- perl/modperl/docs/trunk/src/about/pronounce.pod (original)
&lt;br&gt;+++ perl/modperl/docs/trunk/src/about/pronounce.pod Mon Dec  7 18:34:32 2009
&lt;br&gt;@@ -79,7 +79,6 @@
&lt;br&gt;        &amp;lt;td class=&amp;quot;table-bg&amp;quot;&amp;gt;
&lt;br&gt;                &amp;lt;a href=&amp;quot;pronounce/pereinar.ogg&amp;quot;&amp;gt;Listen&amp;lt;/a&amp;gt;
&lt;br&gt;        &amp;lt;/td&amp;gt;
&lt;br&gt;-
&lt;br&gt; &amp;lt;/tr&amp;gt;
&lt;br&gt; &amp;lt;/table&amp;gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26682466&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;docs-cvs-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26682466&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;docs-cvs-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26682466&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-unsubscribe@...&lt;/a&gt;
&lt;br&gt;For additional commands, e-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26682466&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dev-help@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---Dev-f187.html&quot; embed=&quot;fixTarget[187]&quot; target=&quot;_top&quot; &gt;mod_perl - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Fwd%3A-svn-commit%3A-r888069----perl-modperl-docs-trunk-src-about-pronounce.pod-tp26682466p26682466.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26678452</id>
	<title>Re: Detecting graceful restart/stop in child processes</title>
	<published>2009-12-07T07:01:49Z</published>
	<updated>2009-12-07T07:01:49Z</updated>
	<author>
		<name>Bill Moseley</name>
	</author>
	<content type="html">&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Mon, Dec 7, 2009 at 1:18 AM, André Warnier &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26678452&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;aw@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;

&lt;div class=&quot;im&quot;&gt;Bill Moseley wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
&lt;br&gt;
Again, I&amp;#39;ve got keep alives set for a long time.&lt;br&gt;
&lt;/blockquote&gt;
&lt;br&gt;&lt;/div&gt;
Well, isn&amp;#39;t that your problem then ? &lt;br&gt;&lt;/blockquote&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
KeepAlive connections were introduced at a time when establishing and tearing down TCP connections were relatively expensive things to do.&lt;br&gt;
With modern servers however, this is less important.&lt;br&gt;
&lt;br&gt;
By setting KeepAliveTimeOut long, you essentially &amp;quot;block&amp;quot; a child (and all its resources), doing nothing but waiting for a follow-up request, for a long time after the last related request from the browser has come in, for the dubious benefit of avoiding the setup of a new connection.&lt;br&gt;

&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;This is true for my test environment I described, but that was just for testing and was on purpose.&lt;br&gt;&lt;br&gt;Under production a load balancer is used between the client and the Apache/mod_perl servers.  It works as a proxy where the connection to the client is separate from the connection to the pool of backend processes on each server.  The balancer manages this pool of persistent connections ready to handle requests.  Clients make separate persistent connections on the front of the balancer, too.  But these are not directly connected to any one process.  Requests come in from the presistent clients and the balancer finds a free backend process to handle the request.  The backend services the request very quickly and then is available to service other requests while the client receives its response.  The keep-alive timeouts are different on both sides of the balancer.  &lt;br&gt;

&lt;br&gt;If the balancer maintains persistent connections to the back-end processes then the problem is how to gracefully shut down a server.  Just doing a graceful stop won&amp;#39;t work because the connections keeps the process alive.  One way is to pull the server from the balancer  pool, wait for existing requests to finish (only a few seconds) and then stop the server.   Problem there is that it&amp;#39;s not always the same people running the web servers and balancers.&lt;br&gt;

&lt;br&gt;So, it would be more convenient if a graceful restart could be done on just Apache and that would trigger closing the connections on the next response freeing up the process to exit.  That&amp;#39;s the part I&amp;#39;m trying to get working.&lt;br&gt;

&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;-- &lt;br&gt;Bill Moseley&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26678452&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;moseley@...&lt;/a&gt;&lt;br&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Detecting-graceful-restart-stop-in-child-processes-tp26667107p26678452.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26674572</id>
	<title>Re: Detecting graceful restart/stop in child processes</title>
	<published>2009-12-07T01:18:36Z</published>
	<updated>2009-12-07T01:18:36Z</updated>
	<author>
		<name>awarnier</name>
	</author>
	<content type="html">Bill Moseley wrote:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Again, I've got keep alives set for a long time.
&lt;br&gt;&lt;br&gt;Well, isn't that your problem then ?
&lt;br&gt;KeepAlive connections were introduced at a time when establishing and 
&lt;br&gt;tearing down TCP connections were relatively expensive things to do.
&lt;br&gt;With modern servers however, this is less important.
&lt;br&gt;&lt;br&gt;By setting KeepAliveTimeOut long, you essentially &amp;quot;block&amp;quot; a child (and 
&lt;br&gt;all its resources), doing nothing but waiting for a follow-up request, 
&lt;br&gt;for a long time after the last related request from the browser has come 
&lt;br&gt;in, for the dubious benefit of avoiding the setup of a new connection.
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/mod_perl---General-f190.html&quot; embed=&quot;fixTarget[190]&quot; target=&quot;_top&quot; &gt;mod_perl - General&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Detecting-graceful-restart-stop-in-child-processes-tp26667107p26674572.html" />
</entry>

</feed>
