[freeside-commits] freeside/FS/bin freeside-torrus-srvderive, 1.30, 1.31
Ivan,,,
ivan at wavetail.420.am
Tue Mar 15 18:26:33 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/bin
In directory wavetail.420.am:/tmp/cvs-serv14966
Modified Files:
freeside-torrus-srvderive
Log Message:
fix mysql deadlock handling
Index: freeside-torrus-srvderive
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/bin/freeside-torrus-srvderive,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -w -d -r1.30 -r1.31
--- freeside-torrus-srvderive 15 Mar 2011 21:26:02 -0000 1.30
+++ freeside-torrus-srvderive 16 Mar 2011 01:26:31 -0000 1.31
@@ -59,7 +59,7 @@
";
-while (1) {
+MAIN: while (1) {
my $found = 0;
@@ -131,10 +131,13 @@
my $isth = dbh->prepare($isql) or die $DBI::errstr; #better recovery?
- #stupid mysql deadlocks all the time here, so we need to recover
- $isth->execute( @param ) or do {
+ #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;
+ dbh->rollback; #or die dbh->errstr;
+ sleep 5;
+ next MAIN;
}
}
@@ -151,7 +154,7 @@
}
warn "done with $serviceid\n" if $DEBUG;
- }
+ } #foreach my $torrus_srvderive
dbh->commit or die dbh->errstr;
myexit() if sigterm() || sigint();
More information about the freeside-commits
mailing list