Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Phred (5358)

Phred
  fredNO@SPAMtaperfriendlymusic.org
http://www.redhotpenguin.com/

Fred is a Perl and PostgreSQL geek. He has made some very small contributions to a few cpan modules and mod_perl.

Journal of Phred (5358)

Wednesday November 14, 2007
01:49 AM

ApacheCon Day 1 - mod_perl teamwork

[ #34895 ]

I'm running on about 4 hours sleep in the past 36 hours coming out here to Atlanta, Georgia from San Francisco for ApacheCon. I got to the hotel today and made my way to the hackathon. I managed to find Gozer, and discussed with him some issues I was running into separating Apache::Reload from the mod_perl core codebase. The issue at hand was how to factor out the test code which causes the same mod_perl interpreter to be used for sequential requests. The existing code that does this (TestCommon::SameInterp) uses an http header and then repeatedly sends requests to the Apache::Test server until it receives the same interpreter. Not ideal, and we brainstormed ways to get around that with something more elegant.

Paul Querna was sitting at the table next to ours, so we went over and Gozer picked his brain about the best way to do that. He said that keep-alives turned on should do the trick, since that will force the same interpreter to be used for a given connection. I initially tried that for this stuff, but I was still getting my feet wet with Apache::Test. Gozer worked on getting keep-alives turned on for lwp requests, but somewhere in the Apache::Test guts the keep-alive settings were being overridden.

Right about that time Geoff Young showed up, and we told him what we were up to. He told us how to issue the magic incantation (

Apache::TestRequest::user_agent(keep_alive => 1);

) to Apache::Test to make this work, and a few minutes later we (well mostly Gozer) had ported the cookie unit test to use keep-alives instead of the SameInterp code. The resulting code was 2 lines shorter and makes testing a lot cleaner. I managed to find one more line of code that wasn't needed, so the end result is net 3 lines negative. Couldn't have accomplished this so fast without help from everyone, looking forward to tomorrow.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Sorry I wasn't able to come out to ApacheCon this year. I went last year and you didn't make it, now I'm returning the favor :)

    Maybe next year we can rectify that...