[freeside-commits] freeside/FS/bin freeside-torrus-srvderive, 1.34, 1.35
Ivan,,,
ivan at wavetail.420.am
Thu Apr 7 18:31:50 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/bin
In directory wavetail.420.am:/tmp/cvs-serv23634/FS/bin
Modified Files:
freeside-torrus-srvderive
Log Message:
continue attempting to handle mysql hanging on queries, RT#10574
Index: freeside-torrus-srvderive
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/bin/freeside-torrus-srvderive,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -w -d -r1.34 -r1.35
--- freeside-torrus-srvderive 8 Apr 2011 01:27:56 -0000 1.34
+++ freeside-torrus-srvderive 8 Apr 2011 01:31:48 -0000 1.35
@@ -96,28 +96,22 @@
warn "executing search\n" if $DEBUG;
+ my $alarm = 0;
eval {
- my $h = set_sig_handler(
- 'ALRM', sub {
- local $SIG{__DIE__};
- warn "search timed out\n";
- dbh->clone()->do("KILL QUERY ". dbh->{"mysql_thread_id"})
- if driver_name eq 'mysql';
- die '_timeout';
- },
- { mask=>['ALRM'] , safe=>1 }
- );
+ my $h = set_sig_handler( 'ALRM', sub { $alarm = 1; } );
alarm(5*60); # 15*60);
$sth->execute($serviceid, $serviceid) or die $sth->errstr;
alarm(0);
};
alarm(0);
- if ( $@ =~ /^_timeout/ ) {
+ die $@ if $@;
+
+ if ( $alarm ) {
warn "search timed out; reconnecting and restarting\n";
+ dbh->clone()->do("KILL QUERY ". dbh->{"mysql_thread_id"})
+ if driver_name eq 'mysql';
adminsuidsetup($user);
next MAIN;
- } elsif ( $@ ) {
- die $@;
}
warn "search executed; checking results\n" if $DEBUG;
More information about the freeside-commits
mailing list