Merge branch 'master' of ssh://opensimulator.org/var/git/opensim into htb-throttle

prioritization
John Hurliman 2009-10-06 12:15:24 -07:00
commit fa6027aa09
13 changed files with 101 additions and 91 deletions

View File

@ -55,12 +55,12 @@ namespace OpenSim.Data.MySQL
AuthenticationData ret = new AuthenticationData();
ret.Data = new Dictionary<string, object>();
using (MySqlCommand cmd = new MySqlCommand("select * from `" + m_Realm + "` where UUID = ?principalID"))
{
MySqlCommand cmd = new MySqlCommand("select * from `" + m_Realm + "` where UUID = ?principalID");
cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
using (IDataReader result = ExecuteReader(cmd))
{
IDataReader result = ExecuteReader(cmd);
if (result.Read())
{
ret.PrincipalID = principalID;
@ -82,17 +82,15 @@ namespace OpenSim.Data.MySQL
ret.Data[s] = result[s].ToString();
}
CloseDBConnection(cmd);
CloseDBConnection(result, cmd);
return ret;
}
else
{
CloseDBConnection(cmd);
CloseDBConnection(result, cmd);
return null;
}
}
}
}
public bool Store(AuthenticationData data)
{

View File

@ -40,7 +40,9 @@ namespace OpenSim.Data.MySQL
/// </summary>
public class MySqlFramework
{
private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private static readonly log4net.ILog m_log =
log4net.LogManager.GetLogger(
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
protected MySqlConnection m_Connection;
@ -81,7 +83,8 @@ namespace OpenSim.Data.MySQL
errorSeen = true;
m_Connection.Close();
MySqlConnection newConnection = (MySqlConnection)((ICloneable)m_Connection).Clone();
MySqlConnection newConnection =
(MySqlConnection)((ICloneable)m_Connection).Clone();
m_Connection.Dispose();
m_Connection = newConnection;
m_Connection.Open();
@ -102,15 +105,18 @@ namespace OpenSim.Data.MySQL
protected IDataReader ExecuteReader(MySqlCommand cmd)
{
MySqlConnection newConnection = (MySqlConnection)((ICloneable)m_Connection).Clone();
MySqlConnection newConnection =
(MySqlConnection)((ICloneable)m_Connection).Clone();
newConnection.Open();
cmd.Connection = newConnection;
return cmd.ExecuteReader();
}
protected void CloseDBConnection(MySqlCommand cmd)
protected void CloseDBConnection(IDataReader reader, MySqlCommand cmd)
{
reader.Close();
cmd.Connection.Close();
cmd.Connection.Dispose();
}
}

View File

@ -173,7 +173,7 @@ namespace OpenSim.Data.MySQL
retList.Add(ret);
}
CloseDBConnection(cmd);
CloseDBConnection(result, cmd);
}
return retList;

View File

@ -64,13 +64,13 @@ namespace OpenSim.Data.MySQL
if (scopeID != UUID.Zero)
command += " and ScopeID = ?scopeID";
using (MySqlCommand cmd = new MySqlCommand(command))
{
MySqlCommand cmd = new MySqlCommand(command);
cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
using (IDataReader result = ExecuteReader(cmd))
{
IDataReader result = ExecuteReader(cmd);
if (result.Read())
{
ret.PrincipalID = principalID;
@ -97,17 +97,15 @@ namespace OpenSim.Data.MySQL
ret.Data[s] = result[s].ToString();
}
CloseDBConnection(cmd);
CloseDBConnection(result, cmd);
return ret;
}
else
{
CloseDBConnection(cmd);
CloseDBConnection(result, cmd);
return null;
}
}
}
}
public bool Store(UserAccountData data)
{

View File

@ -318,11 +318,11 @@ namespace OpenSim.Framework.Communications
HttpWebResponse errorResponse = e.Response as HttpWebResponse;
if (null != errorResponse && HttpStatusCode.NotFound == errorResponse.StatusCode)
{
m_log.Warn("[ASSET] Asset not found (404)");
m_log.Warn("[REST CLIENT] Resource not found (404)");
}
else
{
m_log.Error("[ASSET] Error fetching asset from asset server");
m_log.Error("[REST CLIENT] Error fetching resource from server " + _request.Address.ToString());
m_log.Debug(e.ToString());
}

View File

@ -98,7 +98,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Asset
m_log.Info("[RegionAssetService]: Starting...");
Object[] args = new Object[] { m_Config, MainServer.Instance };
Object[] args = new Object[] { m_Config, MainServer.Instance, string.Empty };
ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:AssetServiceConnector", args);
}

View File

@ -98,7 +98,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Inventory
m_log.Info("[RegionInventoryService]: Starting...");
Object[] args = new Object[] { m_Config, MainServer.Instance };
Object[] args = new Object[] { m_Config, MainServer.Instance, String.Empty };
ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:InventoryServiceInConnector", args);
}

View File

@ -61,6 +61,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
private void OnRegionUp(GridRegion otherRegion)
{
// This shouldn't happen
if (otherRegion == null)
return;
m_log.DebugFormat("[REGION CACHE]: (on region {0}) Region {1} is up @ {2}-{3}",
m_scene.RegionInfo.RegionName, otherRegion.RegionName, otherRegion.RegionLocX, otherRegion.RegionLocY);

View File

@ -137,6 +137,8 @@ namespace OpenSim.Region.Framework.Scenes
protected IAssetService m_AssetService = null;
protected IAuthorizationService m_AuthorizationService = null;
private Object m_heartbeatLock = new Object();
public IAssetService AssetService
{
get
@ -940,6 +942,9 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="e"></param>
private void Heartbeat(object sender)
{
if (!Monitor.TryEnter(m_heartbeatLock))
return;
try
{
Update();
@ -950,6 +955,11 @@ namespace OpenSim.Region.Framework.Scenes
catch (ThreadAbortException)
{
}
finally
{
Monitor.Pulse(m_heartbeatLock);
Monitor.Exit(m_heartbeatLock);
}
}
/// <summary>
@ -960,6 +970,12 @@ namespace OpenSim.Region.Framework.Scenes
int maintc = 0;
while (!shuttingdown)
{
//#if DEBUG
// int w = 0, io = 0;
// ThreadPool.GetAvailableThreads(out w, out io);
// if ((w < 10) || (io < 10))
// m_log.DebugFormat("[WARNING]: ThreadPool reaching exhaustion. workers = {0}; io = {1}", w, io);
//#endif
maintc = Environment.TickCount;
TimeSpan SinceLastFrame = DateTime.Now - m_lastupdate;

View File

@ -260,7 +260,7 @@ namespace OpenSim.Server.Base
public static Dictionary<string, object> ParseXmlResponse(string data)
{
m_log.DebugFormat("[XXX]: received xml string: {0}", data);
//m_log.DebugFormat("[XXX]: received xml string: {0}", data);
Dictionary<string, object> ret = new Dictionary<string, object>();

View File

@ -77,6 +77,7 @@ namespace OpenSim.Server.Handlers.Inventory
m_doLookup = serverConfig.GetBoolean("SessionAuthentication", false);
AddHttpHandlers(server);
m_log.Debug("[INVENTORY HANDLER]: handlers initialized");
}
protected virtual void AddHttpHandlers(IHttpServer m_httpServer)

View File

@ -416,13 +416,6 @@ namespace OpenSim.Services.Connectors
e.Source, e.Message);
}
foreach (InventoryItemBase item in items)
{
InventoryItemBase itm = this.QueryItem(userID, item, sessionID);
itm.Name = item.Name;
itm.Folder = item.Folder;
this.UpdateItem(userID, itm, sessionID);
}
}
private void MoveItemsCompleted(IAsyncResult iar)

View File

@ -725,7 +725,6 @@
<Reference name="System"/>
<Reference name="System.Xml"/>
<Reference name="System.Drawing"/>
<Reference name="System.Runtime.Remoting"/>
<Reference name="System.Web"/>
<Reference name="OpenMetaverseTypes.dll"/>
<Reference name="OpenMetaverse.StructuredData.dll"/>
@ -806,7 +805,6 @@
<Reference name="System"/>
<Reference name="System.Xml"/>
<Reference name="System.Data"/>
<Reference name="System.Runtime.Remoting"/>
<Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Data" />
<Reference name="OpenSim.Framework.Communications" />
@ -1540,7 +1538,6 @@
<Reference name="System"/>
<Reference name="System.Xml"/>
<Reference name="System.Drawing"/>
<Reference name="System.Runtime.Remoting"/>
<Reference name="System.Web"/>
<Reference name="OpenMetaverseTypes.dll"/>
<Reference name="OpenMetaverse.StructuredData.dll"/>
@ -1625,7 +1622,6 @@
<Reference name="System"/>
<Reference name="System.Xml"/>
<Reference name="System.Drawing"/>
<Reference name="System.Runtime.Remoting"/>
<Reference name="System.Web"/>
<Reference name="OpenMetaverseTypes.dll"/>
<Reference name="OpenMetaverse.StructuredData.dll"/>
@ -1683,7 +1679,6 @@
<ReferencePath>../../../../bin/</ReferencePath>
<Reference name="System"/>
<Reference name="System.Drawing"/>
<Reference name="System.Runtime.Remoting"/>
<Reference name="System.Xml"/>
<Reference name="OpenSim.Data"/>
<Reference name="OpenSim.Framework"/>
@ -3592,7 +3587,6 @@
<Reference name="System"/>
<Reference name="System.Xml"/>
<Reference name="System.Drawing"/>
<Reference name="System.Runtime.Remoting"/>
<Reference name="OpenMetaverseTypes.dll"/>
<Reference name="OpenMetaverse.dll"/>
<Reference name="OpenSim.Data"/>