First off, let me say hi all and thanks for mod_perl as it was just what I was looking for when starting out this project. The project is an web-based groupware email system which runs as a mod_perl module on apache 1.3.28. Under normal conditions while I'm testing, everything works great. It's fast and stable. However, It seems that if I hit reload quickly while I'm in the state where my app draws the main message list, I get spurious results. Now this doesn't happen everytime that I hit reload before the page is 'done' and received by me, but most. It seems to correlate with the (32)Broken pipe: client stopped connection before rwrite completed message below. I'm using Apache::DBI to handle my db connections ( as well as DBD::Pg and postgresql 7.3.4) and what 'feels' like is happening is that when I request the url it begins to run the normal and appropriate queries. When i hit reload before the queries are done, it seems that the query from 2706 - 2710 gets a value that should have been retrieved in the query on 2720/2727 ... often the value of $page_links{numtotal} is 'someguy' which is a value found in the u.name field of the other query below. Has anyone run into this before? Have any good ideas for me? --jordan
2704 my @row; 2705 my $sth; 2706 my $count_query = "SELECT count(eid) from queue_${queuename}_email"; 2707 $r->warn("[message] ($ENV{REMOTE_ADDR}) Running query $count_query" ) if $debug; 2708 $sth = $dbh->prepare($count_query); 2709 unless ($sth->execute) {return fail($r,SERVER_ERROR,$template->error()); } 2710 $page_links{numtotal} = $sth->fetchrow; 2711 2712 my $unread_query = "SELECT count(eid) from queue_${queuename}_email WHERE date_read IS NULL"; 2713 $r->warn("[message] ($ENV{REMOTE_ADDR}) Running query $unread_query" ) if $debug; 2714 $sth = $dbh->prepare($unread_query); 2715 unless ($sth->execute) {return fail($r,SERVER_ERROR,$template->error()); } 2716 $page_links{numunread} = $sth->fetchrow; 2717 2718 my @messagelist; 2719 2720 my $message_query = "SELECT e.eid, e.sender, e.subject, e.level, e.date_read, e.locked, e.hasattach, e.hasnote, e.assigned_to, to_char(t.stamp,'FMMM/FMDD/FMYY HH24:MI'), u.name FROM queue_${queuename}_timestamp t, queue_${queuename}_email e LEFT JOIN users u ON e.assigned_to = u.uid WHERE e.eid = t.eid ORDER BY $sort $limitclause"; 2721 2722 $r->warn(" ($ENV{REMOTE_ADDR}) Running query $message_query" ) if $debug; 2723 2724 2725 my $time_before = time() - $start_time; 2726 $sth = $dbh->prepare($message_query); 2727 my $rows = $sth->execute; 2728 my $time_after = time() - $start_time; 2729 $page_links{numend} = $page_links{numstart} + $rows ; 2730 $page_links{numend}--; 2731 while ( @row = $sth->fetchrow_array) { 2732 2733 my $message = { 2734 'eid' => $row[0], 2735 'sender' => clean_sender($row[1]), 2736 'subject' => $row[2], 2737 'level' => $row[3], 2738 'new' => $row[4], 2739 'locked' => islocked($cookie,$row[0]), 2740 'attach' => $row[6], 2741 'note' => $row[7], 2742 'assignedto' => $row[10], 2743 'date' => $row[9], 2744 'link' => $q2_baseurl . 'view/' . $row[0], 2745 'color' => $color{n2w($row[3])} 2746 }; 2747 if ( defined($message->{'new'}) ) { $message->{'new'} = 0 } else { $message->{'new'} = 1 } 2748 $message->{'subject'} = 'no subject' unless ($message->{'subject'}); 2749 if ( length($message->{'subject'}) > $maxsubjectlength ) { $message->{'subject'} = substr($message ->{'subject'},0,$maxsubjectlength) . '...'; } 2750 if ( length($message->{'sender'}) > $maxsenderlength ) { $message->{'sender'} = substr($message->{ 'sender'},0,$maxsenderlength); } 2751 if (( $message->{assignedto} ) and ($user{name} eq $message->{'assignedto'}) ) { $message->{mine} = 1; } 2752 push @messagelist, $message; 2753 } 2754 2755 2756 my $time_list = time() - $start_time; 2757 2758 my %queue; 2759 $queue{name} = $queuename; 2760 $queue{id} = $user{qid}; 2761 2762 my $ptime = time() - $start_time; 2763 #my @chatter = getchat($user{qid},20); 2764 my $vars = { 2765 nav => \%nav, 2766 queue => \%queue, 2767 messagelist => [EMAIL PROTECTED], 2768 chatter => [EMAIL PROTECTED], 2769 page => \%page_links, 2770 time_enter => $time_enter, 2771 time_check => $time_check, 2772 time_cleanlocks => $time_cleanlocks, 2773 time_killmylocks => $time_killmylocks, 2774 time_getuser => $time_getuser, 2775 time_before => $time_before, 2776 time_after => $time_after, 2777 time_list => $time_list, 2778 ptime => $ptime 2779 2780 }; 2781 my $input = 'header.tmpl'; 2782 $template->process($input, $vars) || return fail ($r, SERVER_ERROR, $template->error()); 2783 $input = 'nav.tmpl'; 2784 $template->process($input, $vars) || return fail ($r, SERVER_ERROR, $template->error()); 2785 $input = 'messages.tmpl'; 2786 $template->process($input, $vars) || return fail ($r, SERVER_ERROR, $template->error()); 2787 $input = 'footer.tmpl'; 2788 $template->process($input, $vars) || return fail ($r, SERVER_ERROR, $template->error()); 2789 return OK; 2790 } ==> apache/logs/error_log <== [Fri Nov 21 13:24:08 2003] [warn] [message] (123.123.123.123) Running query SELECT count(eid) from queue_foo_email [Fri Nov 21 13:24:08 2003] [warn] [message] (123.123.123.123) Running query SELECT count(eid) from queue_foo_email WHERE date_read IS NULL [Fri Nov 21 13:24:08 2003] [warn] (123.123.123.123) Running query SELECT e.eid, e.sender, e.subject, e.level, e.date_read, e.locked, e.hasattach, e.hasnote, e.assigned_to, to_char(t.stamp,'FMMM/FMDD/FMYY HH24:MI'), u.name FROM queue_foo_timestamp t, queue_foo_email e LEFT JOIN users u ON e.assigned_to = u.uid WHERE e.eid = t.eid ORDER BY e. level DESC, t.stamp DESC LIMIT 20 Argument "someguy" isn't numeric in numeric gt (>) at (eval 93) line 24 (#2) (W numeric) The indicated string was fed as an argument to an operator that expected a numeric value instead. If you're fortunate the message will identify which operator was so unfortunate. Argument "someguy" isn't numeric in numeric gt (>) at (eval 93) line 24. diagnostics::warn_trap('Argument "someguy" isn\'t numeric in numeric gt (>) at (eval ...') called at (eval 93) line 24 eval {...} called at (eval 93) line 7 Template::Document::__ANON__('Template::Context=HASH(0x8b92cec)') called at /usr/local/lib/perl5/site_perl/5.8.1/i686-linux/Template/Document.pm line 141 eval {...} called at /usr/local/lib/perl5/site_perl/5.8.1/i686-linux/Template/Document.pm line 139 Template::Document::process('Template::Document=HASH(0x85ec3bc)','Template::Context=HASH(0x8b92cec)') called at /usr/local/lib/perl5/site_perl/5.8.1/i686-linux/Template/Context.pm line 336 eval {...} called at /usr/local/lib/perl5/site_perl/5.8.1/i686-linux/Template/Context.pm line 320 Template::Context::process('Template::Context=HASH(0x8b92cec)','Template::Document=HASH(0x85ec3bc)') called at /usr/local/lib/perl5/site_perl/5.8.1/i686-linux/Template/Service.pm line 97 eval {...} called at /usr/local/lib/perl5/site_perl/5.8.1/i686-linux/Template/Service.pm line 94 Template::Service::process('Template::Service=HASH(0x85ef2cc)','messages.tmpl','HASH(0x85ed4cc)') called at /usr/local/lib/perl5/site_perl/5.8.1/i686-linux/Template.pm line 76 Template::process('Template=HASH(0x85ee3f0)','messages.tmpl','HASH(0x85ed4cc)') called at /proj/q2/lib/Q2/Init.pm line 2783 Q2::Init::handler('Apache=SCALAR(0x8b26f64)') called at /dev/null line 0 eval {...} called at /dev/null line 0 [Fri Nov 21 12:24:45 2003] [info] [client 123.123.123.123 ] (32)Broken pipe: client stopped connection before rwrite completed -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html