And one more patch before sleep

This annoying sleep during startup-problem still sometimes causes exceptions, so added some retry...
ThreadPoolClientBranch
Tedd Hansen 2008-02-02 05:14:50 +00:00
parent b57d9be856
commit 1fa510d26d
2 changed files with 43 additions and 29 deletions

View File

@ -419,6 +419,12 @@ namespace OpenSim.Framework.Data.MySQL
MainLog.Instance.Verbose("DATASTORE", "Tedds temp fix: Waiting 3 seconds for stuff to catch up. (Someone please fix! :))"); MainLog.Instance.Verbose("DATASTORE", "Tedds temp fix: Waiting 3 seconds for stuff to catch up. (Someone please fix! :))");
System.Threading.Thread.Sleep(3000); System.Threading.Thread.Sleep(3000);
int loopCount = 0;
while (true)
{
loopCount++;
try
{
lock (m_dataSet) lock (m_dataSet)
{ {
DataTable land = m_landTable; DataTable land = m_landTable;
@ -440,7 +446,8 @@ namespace OpenSim.Framework.Data.MySQL
MySqlCommand cmd = MySqlCommand cmd =
new MySqlCommand("delete from landaccesslist where LandUUID=?LandUUID", m_connection)) new MySqlCommand("delete from landaccesslist where LandUUID=?LandUUID", m_connection))
{ {
cmd.Parameters.Add(new MySqlParameter("?LandUUID", Util.ToRawUuidString(parcel.landData.globalID))); cmd.Parameters.Add(
new MySqlParameter("?LandUUID", Util.ToRawUuidString(parcel.landData.globalID)));
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
} }
@ -451,8 +458,16 @@ namespace OpenSim.Framework.Data.MySQL
landaccesslist.Rows.Add(newAccessRow); landaccesslist.Rows.Add(newAccessRow);
} }
} }
Commit(); Commit();
break;
}
catch (Exception ex)
{
System.Console.WriteLine("Tedds temp fix exception, will repeat taks: " + ex.ToString());
if (loopCount > 3)
throw (ex);
}
}
} }
public List<LandData> LoadLandObjects(LLUUID regionUUID) public List<LandData> LoadLandObjects(LLUUID regionUUID)

View File

@ -207,7 +207,6 @@ LoadUnloadMaxQueueSize=100
; Maximum number of (LSL) events that can be queued before new events are ignored. ; Maximum number of (LSL) events that can be queued before new events are ignored.
EventExecutionMaxQueueSize=300 EventExecutionMaxQueueSize=300
; Async LL command sleep ; Async LL command sleep
; If no async LL commands are waiting, how long should thread sleep before checking again ; If no async LL commands are waiting, how long should thread sleep before checking again
; Async LL commands are LSL-commands that causes an event to be fired back with result ; Async LL commands are LSL-commands that causes an event to be fired back with result