[freeside-commits] freeside/FS/bin freeside-torrus-srvderive, 1.42, 1.43
Ivan,,,
ivan at wavetail.420.am
Sun Apr 17 11:18:00 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/bin
In directory wavetail.420.am:/tmp/cvs-serv16807
Modified Files:
freeside-torrus-srvderive
Log Message:
try at a multiprocess torrus-srvderive to hopefully catch/keep up, RT#10574
Index: freeside-torrus-srvderive
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/bin/freeside-torrus-srvderive,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -w -d -r1.42 -r1.43
--- freeside-torrus-srvderive 17 Apr 2011 18:03:50 -0000 1.42
+++ freeside-torrus-srvderive 17 Apr 2011 18:17:58 -0000 1.43
@@ -64,11 +64,13 @@
our $kids = 0;
-MAIN: while (1) {
+#MAIN: while (1) {
+while (1) {
my $found = 0;
- SERVICEID: foreach my $torrus_srvderive ( qsearch('torrus_srvderive', {}) ) {
+ #SERVICEID: foreach my $torrus_srvderive ( qsearch('torrus_srvderive', {}) ) {
+ foreach my $torrus_srvderive ( qsearch('torrus_srvderive', {}) ) {
&reap_kids;
if ( $kids >= $max_kids ) {
@@ -95,7 +97,7 @@
my $serviceid = $torrus_srvderive->serviceid;
my @serviceids = $torrus_srvderive->component_serviceids;
- next unless @serviceids; #don't try to search for empty virtual ports
+ exit unless @serviceids; #don't try to search for empty virtual ports
my @in = ();
for my $dir ('_IN', '_OUT') {
@@ -118,7 +120,7 @@
die $error if $error;
} else {
warn "no initial last_srv_date for $serviceid; skipping\n" if $DEBUG;
- next;
+ exit;
}
}
@@ -149,12 +151,14 @@
alarm(0);
if ( $@ && $@ eq "_timeout\n" ) {
- warn "search timed out; reconnecting and restarting\n";
+ #warn "search timed out; reconnecting and restarting\n";
+ warn "search timed out\n";
dbh->clone()->do("KILL QUERY ". dbh->{"mysql_thread_id"})
if driver_name eq 'mysql';
dbh->rollback; #or die dbh->errstr;
- adminsuidsetup($user);
- next SERVICEID; #MAIN;
+ #adminsuidsetup($user);
+ #next SERVICEID; #MAIN;
+ exit;
} elsif ( $@ ) {
die $@;
}
@@ -200,11 +204,13 @@
#stupid mysql deadlocks all the time on insert, so we need to recover
unless ( $isth->execute(@param) ) {
- warn "Error inserting data for $serviceid$dir (restarting): ".
- $isth->errstr;
+ #warn "Error inserting data for $serviceid$dir (restarting): ".
+ # $isth->errstr;
+ warn "Error inserting data for $serviceid$dir: ". $isth->errstr;
dbh->rollback; #or die dbh->errstr;
- sleep 5;
- next SERVICEID; #MAIN;
+ #sleep 5;
+ #next SERVICEID; #MAIN;
+ exit;
}
}
More information about the freeside-commits
mailing list