aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-07-13 00:44:00 +0100
committerJustin Clark-Casey (justincc)2012-07-13 00:44:00 +0100
commit9ccb5787211f81c1c2059aa4b889f68cd460b539 (patch)
tree367d0127c8fb202d8ac7c929e48a9f5179600e39
parentStop redundantly passing in the endpoint to the LLClientView constructor. (diff)
downloadopensim-SC_OLD-9ccb5787211f81c1c2059aa4b889f68cd460b539.zip
opensim-SC_OLD-9ccb5787211f81c1c2059aa4b889f68cd460b539.tar.gz
opensim-SC_OLD-9ccb5787211f81c1c2059aa4b889f68cd460b539.tar.bz2
opensim-SC_OLD-9ccb5787211f81c1c2059aa4b889f68cd460b539.tar.xz
Don't cache regions data on the other unused LocalGridServiceConnector that the module code still sets up even if we're using one directly instantiated from the RemoteGridServiceConnector.
Also improves log messages to indicate which regions are sending/receiving various neighbour protocol messages.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs35
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs1
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs22
4 files changed, 42 insertions, 22 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
index 540f33a..01be339 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
@@ -41,8 +41,7 @@ using OpenMetaverse;
41 41
42namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid 42namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
43{ 43{
44 public class LocalGridServicesConnector : 44 public class LocalGridServicesConnector : ISharedRegionModule, IGridService
45 ISharedRegionModule, IGridService
46 { 45 {
47 private static readonly ILog m_log = 46 private static readonly ILog m_log =
48 LogManager.GetLogger( 47 LogManager.GetLogger(
@@ -51,7 +50,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
51 private IGridService m_GridService; 50 private IGridService m_GridService;
52 private Dictionary<UUID, RegionCache> m_LocalCache = new Dictionary<UUID, RegionCache>(); 51 private Dictionary<UUID, RegionCache> m_LocalCache = new Dictionary<UUID, RegionCache>();
53 52
54 private bool m_Enabled = false; 53 private bool m_Enabled;
55 54
56 public LocalGridServicesConnector() 55 public LocalGridServicesConnector()
57 { 56 {
@@ -59,7 +58,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
59 58
60 public LocalGridServicesConnector(IConfigSource source) 59 public LocalGridServicesConnector(IConfigSource source)
61 { 60 {
62 m_log.Debug("[LOCAL GRID CONNECTOR]: LocalGridServicesConnector instantiated"); 61 m_log.Debug("[LOCAL GRID SERVICE CONNECTOR]: LocalGridServicesConnector instantiated directly.");
63 InitialiseService(source); 62 InitialiseService(source);
64 } 63 }
65 64
@@ -84,8 +83,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
84 if (name == Name) 83 if (name == Name)
85 { 84 {
86 InitialiseService(source); 85 InitialiseService(source);
87 m_Enabled = true; 86 m_log.Info("[LOCAL GRID SERVICE CONNECTOR]: Local grid connector enabled");
88 m_log.Info("[LOCAL GRID CONNECTOR]: Local grid connector enabled");
89 } 87 }
90 } 88 }
91 } 89 }
@@ -95,7 +93,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
95 IConfig assetConfig = source.Configs["GridService"]; 93 IConfig assetConfig = source.Configs["GridService"];
96 if (assetConfig == null) 94 if (assetConfig == null)
97 { 95 {
98 m_log.Error("[LOCAL GRID CONNECTOR]: GridService missing from OpenSim.ini"); 96 m_log.Error("[LOCAL GRID SERVICE CONNECTOR]: GridService missing from OpenSim.ini");
99 return; 97 return;
100 } 98 }
101 99
@@ -104,7 +102,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
104 102
105 if (serviceDll == String.Empty) 103 if (serviceDll == String.Empty)
106 { 104 {
107 m_log.Error("[LOCAL GRID CONNECTOR]: No LocalServiceModule named in section GridService"); 105 m_log.Error("[LOCAL GRID SERVICE CONNECTOR]: No LocalServiceModule named in section GridService");
108 return; 106 return;
109 } 107 }
110 108
@@ -115,16 +113,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
115 113
116 if (m_GridService == null) 114 if (m_GridService == null)
117 { 115 {
118 m_log.Error("[LOCAL GRID CONNECTOR]: Can't load grid service"); 116 m_log.Error("[LOCAL GRID SERVICE CONNECTOR]: Can't load grid service");
119 return; 117 return;
120 } 118 }
119
120 m_Enabled = true;
121 } 121 }
122 122
123 public void PostInitialise() 123 public void PostInitialise()
124 { 124 {
125 // FIXME: We will still add this command even if we aren't enabled since RemoteGridServiceConnector
126 // will have instantiated us directly.
125 MainConsole.Instance.Commands.AddCommand("Regions", false, "show neighbours", 127 MainConsole.Instance.Commands.AddCommand("Regions", false, "show neighbours",
126 "show neighbours", 128 "show neighbours",
127 "Shows the local regions' neighbours", NeighboursCommand); 129 "Shows the local regions' neighbours", HandleShowNeighboursCommand);
128 } 130 }
129 131
130 public void Close() 132 public void Close()
@@ -133,17 +135,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
133 135
134 public void AddRegion(Scene scene) 136 public void AddRegion(Scene scene)
135 { 137 {
136 if (m_Enabled) 138 if (!m_Enabled)
137 scene.RegisterModuleInterface<IGridService>(this); 139 return;
140
141 scene.RegisterModuleInterface<IGridService>(this);
138 142
139 if (m_LocalCache.ContainsKey(scene.RegionInfo.RegionID)) 143 if (m_LocalCache.ContainsKey(scene.RegionInfo.RegionID))
140 m_log.ErrorFormat("[LOCAL GRID CONNECTOR]: simulator seems to have more than one region with the same UUID. Please correct this!"); 144 m_log.ErrorFormat("[LOCAL GRID SERVICE CONNECTOR]: simulator seems to have more than one region with the same UUID. Please correct this!");
141 else 145 else
142 m_LocalCache.Add(scene.RegionInfo.RegionID, new RegionCache(scene)); 146 m_LocalCache.Add(scene.RegionInfo.RegionID, new RegionCache(scene));
143 } 147 }
144 148
145 public void RemoveRegion(Scene scene) 149 public void RemoveRegion(Scene scene)
146 { 150 {
151 if (!m_Enabled)
152 return;
153
147 m_LocalCache[scene.RegionInfo.RegionID].Clear(); 154 m_LocalCache[scene.RegionInfo.RegionID].Clear();
148 m_LocalCache.Remove(scene.RegionInfo.RegionID); 155 m_LocalCache.Remove(scene.RegionInfo.RegionID);
149 } 156 }
@@ -232,7 +239,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
232 239
233 #endregion 240 #endregion
234 241
235 public void NeighboursCommand(string module, string[] cmdparams) 242 public void HandleShowNeighboursCommand(string module, string[] cmdparams)
236 { 243 {
237 System.Text.StringBuilder caps = new System.Text.StringBuilder(); 244 System.Text.StringBuilder caps = new System.Text.StringBuilder();
238 245
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs
index 9172536..8d83fb6 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs
@@ -55,6 +55,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
55 55
56 public RegionCache(Scene s) 56 public RegionCache(Scene s)
57 { 57 {
58 Util.PrintCallStack();
58 m_scene = s; 59 m_scene = s;
59 m_scene.EventManager.OnRegionUp += OnRegionUp; 60 m_scene.EventManager.OnRegionUp += OnRegionUp;
60 } 61 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs
index 40cc536..7a90686 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs
@@ -125,13 +125,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour
125 uint x, y; 125 uint x, y;
126 Utils.LongToUInts(regionHandle, out x, out y); 126 Utils.LongToUInts(regionHandle, out x, out y);
127 127
128 m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: HelloNeighbour from region {0} to region at {1}-{2}",
129 thisRegion.RegionName, x / Constants.RegionSize, y / Constants.RegionSize);
130
131 foreach (Scene s in m_Scenes) 128 foreach (Scene s in m_Scenes)
132 { 129 {
133 if (s.RegionInfo.RegionHandle == regionHandle) 130 if (s.RegionInfo.RegionHandle == regionHandle)
134 { 131 {
132 m_log.DebugFormat("[LOCAL NEIGHBOUR SERVICE CONNECTOR]: HelloNeighbour from region {0} to neighbour {1} at {2}-{3}",
133 thisRegion.RegionName, s.Name, x / Constants.RegionSize, y / Constants.RegionSize);
134
135 //m_log.Debug("[NEIGHBOUR CONNECTOR]: Found region to SendHelloNeighbour"); 135 //m_log.Debug("[NEIGHBOUR CONNECTOR]: Found region to SendHelloNeighbour");
136 return s.IncomingHelloNeighbour(thisRegion); 136 return s.IncomingHelloNeighbour(thisRegion);
137 } 137 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index eff635b..661e03c 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -84,16 +84,23 @@ namespace OpenSim.Region.Framework.Scenes
84 if (neighbourService != null) 84 if (neighbourService != null)
85 neighbour = neighbourService.HelloNeighbour(regionhandle, region); 85 neighbour = neighbourService.HelloNeighbour(regionhandle, region);
86 else 86 else
87 m_log.DebugFormat("[SCENE COMMUNICATION SERVICE]: No neighbour service provided for informing neigbhours of this region"); 87 m_log.DebugFormat(
88 "[SCENE COMMUNICATION SERVICE]: No neighbour service provided for region {0} to inform neigbhours of status",
89 m_scene.Name);
88 90
89 if (neighbour != null) 91 if (neighbour != null)
90 { 92 {
91 m_log.DebugFormat("[SCENE COMMUNICATION SERVICE]: Successfully informed neighbour {0}-{1} that I'm here", x / Constants.RegionSize, y / Constants.RegionSize); 93 m_log.DebugFormat(
94 "[SCENE COMMUNICATION SERVICE]: Region {0} successfully informed neighbour {1} at {2}-{3} that it is up",
95 m_scene.Name, neighbour.RegionName, x / Constants.RegionSize, y / Constants.RegionSize);
96
92 m_scene.EventManager.TriggerOnRegionUp(neighbour); 97 m_scene.EventManager.TriggerOnRegionUp(neighbour);
93 } 98 }
94 else 99 else
95 { 100 {
96 m_log.InfoFormat("[SCENE COMMUNICATION SERVICE]: Failed to inform neighbour {0}-{1} that I'm here.", x / Constants.RegionSize, y / Constants.RegionSize); 101 m_log.WarnFormat(
102 "[SCENE COMMUNICATION SERVICE]: Region {0} failed to inform neighbour at {1}-{2} that it is up.",
103 x / Constants.RegionSize, y / Constants.RegionSize);
97 } 104 }
98 } 105 }
99 106
@@ -101,8 +108,13 @@ namespace OpenSim.Region.Framework.Scenes
101 { 108 {
102 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName); 109 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName);
103 110
104 List<GridRegion> neighbours = m_scene.GridService.GetNeighbours(m_scene.RegionInfo.ScopeID, m_scene.RegionInfo.RegionID); 111 List<GridRegion> neighbours
105 m_log.DebugFormat("[SCENE COMMUNICATION SERVICE]: Informing {0} neighbours that this region is up", neighbours.Count); 112 = m_scene.GridService.GetNeighbours(m_scene.RegionInfo.ScopeID, m_scene.RegionInfo.RegionID);
113
114 m_log.DebugFormat(
115 "[SCENE COMMUNICATION SERVICE]: Informing {0} neighbours that region {1} is up",
116 neighbours.Count, m_scene.Name);
117
106 foreach (GridRegion n in neighbours) 118 foreach (GridRegion n in neighbours)
107 { 119 {
108 InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync; 120 InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync;