You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Balazs Rauznitz <ba...@commissioner.com> on 2002/01/25 07:11:17 UTC

DBI/MySQL causing SIGPIPE

My setup is apache/modperl+Apache::DBI with MySQL driver. On server startup in every httpd child a few queries that are executed very often are prepared. When the Apache::Registry scripts run values are bound to the cursors and they are executed. The server runs ok for 6-10 hours and then I'm seeing these messages in the error_log when trying to execute the cursors 

[modperl] caught SIGPIPE in process 12620
    hint: may be a client (browser) hit STOP?

My initial guess was that the mysql daemon of the cursor has exitted, so I had the library recompiled by having all apache children execute a "do 'db.pl'" using a custom USR2 handler. Take a look at the file below: I think that the db connection and the cursor should have been reinitialized, but the SIGPPIPE remained. Now my guess is that Apache::DBI gets confused somehow... To stop the problem I added a $SIG{PIPE} = sub {} into the code, which works well, but isn't this going to cause other problems with mod_perl ?

apache 		1.3.12
mod_per	 	1.23
perl		5.005_03
Apache::DBI 	0.87
DBI	  	1.14

Any help would be greatly appreciated.

Thanks,

-Balazs

ps: The library looks something like this:

#db.pl
$DBH = &connect();
$CURSOR = $DBH->prepare("some sql");

sub routine {
    $CURSOR->bind_param(1, "$_[0]");
    $SUSPECTS_CUR->execute();
    .
    .
}