diff options
author | ivan <ivan> | 2011-04-08 01:27:56 +0000 |
---|---|---|
committer | ivan <ivan> | 2011-04-08 01:27:56 +0000 |
commit | 28ba04005c9ac95f4539257a95d23eeef9705206 (patch) | |
tree | 4680d9f2dfbb67077ccfad1c57a44d2eea7a2b72 /FS | |
parent | 40b7a4573412f467853f9681b71014fd78c2b4c6 (diff) |
continue attempting to handle mysql hanging on queries, RT#10574
Diffstat (limited to 'FS')
-rw-r--r-- | FS/bin/freeside-torrus-srvderive | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/FS/bin/freeside-torrus-srvderive b/FS/bin/freeside-torrus-srvderive index 95cc76daa..4ee367bd4 100644 --- a/FS/bin/freeside-torrus-srvderive +++ b/FS/bin/freeside-torrus-srvderive @@ -94,11 +94,13 @@ MAIN: while (1) { warn $ssql if $DEBUG > 2; my $sth = dbh->prepare($ssql) or die $DBI::errstr; #better recovery here? - warn "executing search" if $DEBUG; + warn "executing search\n" if $DEBUG; eval { - my $timeout = set_sig_handler( + 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'; @@ -118,7 +120,7 @@ MAIN: while (1) { die $@; } - warn "search executed; checking results" if $DEBUG; + warn "search executed; checking results\n" if $DEBUG; my $prev = 0; while ( my $row = $sth->fetchrow_arrayref ) { |