summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2011-04-17 18:17:58 +0000
committerivan <ivan>2011-04-17 18:17:58 +0000
commit3d6aa5f93ba2971c43514a5d70ec5398607c4747 (patch)
treee80a1a6640f62e1f07ef547262dcd75b6e81fbf3
parentfe7acedd9abad4a0cd9e32e751e8f22b403d2d03 (diff)
try at a multiprocess torrus-srvderive to hopefully catch/keep up, RT#10574
-rw-r--r--FS/bin/freeside-torrus-srvderive28
1 files changed, 17 insertions, 11 deletions
diff --git a/FS/bin/freeside-torrus-srvderive b/FS/bin/freeside-torrus-srvderive
index 7a42f51f0..e5a05d078 100644
--- a/FS/bin/freeside-torrus-srvderive
+++ b/FS/bin/freeside-torrus-srvderive
@@ -64,11 +64,13 @@ my $orderlimit = "
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 @@ MAIN: while (1) {
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 @@ MAIN: while (1) {
die $error if $error;
} else {
warn "no initial last_srv_date for $serviceid; skipping\n" if $DEBUG;
- next;
+ exit;
}
}
@@ -149,12 +151,14 @@ MAIN: while (1) {
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 @@ MAIN: while (1) {
#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;
}
}