Mod_perl problem as follows, check out my Mason autohandler, synopsis, at end:
<%shared> ## Verfiy we have a cookie with a _session_id my $c = Apache2::Cookie->fetch($r); if ( exists $c->{'WBT_Session'} ) { $c= ($c->{'WBT_Session'}->value)[0]; } else { $m->clear_buffer; $m->subexec('/index.html', error => 201 ); $m->abort; } ## Verify we have session that matches cookies ID my %APACHE_SESSION; eval { tie %APACHE_SESSION, 'Apache::Session::Postgres', $c, { Handle => $dbh, Commit => 1, };}; if ( $@ ) { if ( $@ ) { ## No tuple with matching ID (form cookie), bogus data. $m->clear_buffer; $dbh->rollback; $m->subexec('/index.html', error => 301 ); $m->abort; } } ## Verify that the sessioned user still has an entry in the users ta +ble ## Save user information into $U by ref my $U = $dbh->selectrow_hashref( qq{ SELECT * FROM "users" WHERE pkid = ? }, {}, $APACHE_SESSION{'p +kid'} ); if ( defined $U ) { ##@@## HERE IS PROBLEM ##@@## WORKS FINE IF I DON'T SEND S ( %APACHE_SESSION REF ) ##@@## STALLS IF I SEND S! $m->call_next( S => \%APACHE_SESSION, U => $U); } else { $m->clear_buffer; $m->subexec('/index.html', error => 101 ); $m->abort; } </%shared> <%cleanup> $dbh->commit(); untie %APACHE_SESSION; </%cleanup>

What happens is this:
  1. autohandler, finds a WBT_Session cookie or errors
  2. cookie session value refrences _a_session value in session table
  3. it reads users id from session table.
  4. refrences that userid with user data from user tbl.
  5. calls the next mason component in the stack with a refrence to Apache::Session::Postgres object, and a refrence to the user data from user table.

The problem is in the sesion object, at first I figured this would be one thread/fork per process, so refrences would be valid, and but aparently they aren't. If I comment out the the sending of the sesion refnrece everything works fine and dandy, however If i uncomment out session refrence apache just hangs indefinitly.


www.wbt-modules.com, for example of hang up.

anyone have any ideas on how to fix this problem, or even what it is



Evan Carroll
www.EvanCarroll.com


update

This prolbem is so damn weird, everything works fine if I change this:

if ( defined $U ) { $m->call_next( S => \%APACHE_SESSION, U => $U); }
if ( defined $U ) { my %APACHE_SESSION = %APACHE_SESSION; $m->call_next( S => \%APACHE_SESSION, U => $U); }

In reply to Major Mod_perl/Apache2 dilema by EvanCarroll

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.