projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bd30861
)
continue attempting to handle mysql hanging on queries, RT#10574
author
ivan
<ivan>
Fri, 8 Apr 2011 01:36:56 +0000
(
01:36
+0000)
committer
ivan
<ivan>
Fri, 8 Apr 2011 01:36:56 +0000
(
01:36
+0000)
FS/bin/freeside-torrus-srvderive
patch
|
blob
|
history
diff --git
a/FS/bin/freeside-torrus-srvderive
b/FS/bin/freeside-torrus-srvderive
index
0bf2db8
..
61d5fe6
100644
(file)
--- a/
FS/bin/freeside-torrus-srvderive
+++ b/
FS/bin/freeside-torrus-srvderive
@@
-96,22
+96,22
@@
MAIN: while (1) {
warn "executing search\n" if $DEBUG;
warn "executing search\n" if $DEBUG;
- my $alarm = 0;
eval {
eval {
- my $h = set_sig_handler( 'ALRM', sub {
$alarm = 1
; } );
+ my $h = set_sig_handler( 'ALRM', sub {
die "_timeout\n"
; } );
alarm(5*60); # 15*60);
$sth->execute($serviceid, $serviceid) or die $sth->errstr;
alarm(0);
};
alarm(0);
alarm(5*60); # 15*60);
$sth->execute($serviceid, $serviceid) or die $sth->errstr;
alarm(0);
};
alarm(0);
- die $@ if $@;
- if ( $
alarm
) {
+ if ( $
@ && $@ eq "_timeout\n"
) {
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;
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;
}
warn "search executed; checking results\n" if $DEBUG;