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

@ -418,41 +418,56 @@ 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);
lock (m_dataSet) int loopCount = 0;
while (true)
{ {
DataTable land = m_landTable; loopCount++;
DataTable landaccesslist = m_landAccessListTable; try
{
lock (m_dataSet)
{
DataTable land = m_landTable;
DataTable landaccesslist = m_landAccessListTable;
DataRow landRow = land.Rows.Find(Util.ToRawUuidString(parcel.landData.globalID)); DataRow landRow = land.Rows.Find(Util.ToRawUuidString(parcel.landData.globalID));
if (landRow == null) if (landRow == null)
{ {
landRow = land.NewRow(); landRow = land.NewRow();
fillLandRow(landRow, parcel.landData, regionUUID); fillLandRow(landRow, parcel.landData, regionUUID);
land.Rows.Add(landRow); land.Rows.Add(landRow);
} }
else else
{ {
fillLandRow(landRow, parcel.landData, regionUUID); fillLandRow(landRow, parcel.landData, regionUUID);
} }
using ( using (
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(
cmd.ExecuteNonQuery(); new MySqlParameter("?LandUUID", Util.ToRawUuidString(parcel.landData.globalID)));
} cmd.ExecuteNonQuery();
}
foreach (ParcelManager.ParcelAccessEntry entry in parcel.landData.parcelAccessList) foreach (ParcelManager.ParcelAccessEntry entry in parcel.landData.parcelAccessList)
{
DataRow newAccessRow = landaccesslist.NewRow();
fillLandAccessRow(newAccessRow, entry, parcel.landData.globalID);
landaccesslist.Rows.Add(newAccessRow);
}
}
Commit();
break;
}
catch (Exception ex)
{ {
DataRow newAccessRow = landaccesslist.NewRow(); System.Console.WriteLine("Tedds temp fix exception, will repeat taks: " + ex.ToString());
fillLandAccessRow(newAccessRow, entry, parcel.landData.globalID); if (loopCount > 3)
landaccesslist.Rows.Add(newAccessRow); throw (ex);
} }
} }
Commit();
} }
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