diff options
author | Justin Clarke Casey | 2008-11-04 21:30:57 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-11-04 21:30:57 +0000 |
commit | 8851db0a0ac6c100933c79bcc0135c9aa9dc7c08 (patch) | |
tree | 1ed8ba19c06132d7c78afd5b6e3c569e15b2d021 /OpenSim/Region/Environment/Modules/ContentManagementSystem | |
parent | * Prevent texture sender thread termination from immediately crashing the sim (diff) | |
download | opensim-SC_OLD-8851db0a0ac6c100933c79bcc0135c9aa9dc7c08.zip opensim-SC_OLD-8851db0a0ac6c100933c79bcc0135c9aa9dc7c08.tar.gz opensim-SC_OLD-8851db0a0ac6c100933c79bcc0135c9aa9dc7c08.tar.bz2 opensim-SC_OLD-8851db0a0ac6c100933c79bcc0135c9aa9dc7c08.tar.xz |
* Stop an exception in the Content Management module main loop from crashing the whole sim
Diffstat (limited to 'OpenSim/Region/Environment/Modules/ContentManagementSystem')
-rw-r--r-- | OpenSim/Region/Environment/Modules/ContentManagementSystem/CMController.cs | 78 |
1 files changed, 44 insertions, 34 deletions
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMController.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMController.cs index 6eaaacd..02c4ab0 100644 --- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMController.cs +++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/CMController.cs | |||
@@ -162,44 +162,54 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement | |||
162 | /// </summary> | 162 | /// </summary> |
163 | private void MainLoop() | 163 | private void MainLoop() |
164 | { | 164 | { |
165 | CMModel model = m_model; CMView view = m_view; int channel = m_channel; | 165 | try |
166 | Work currentJob = new Work(); | ||
167 | while (true) | ||
168 | { | 166 | { |
169 | currentJob = m_WorkQueue.Dequeue(); | 167 | CMModel model = m_model; CMView view = m_view; int channel = m_channel; |
170 | m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- DeQueued a request"); | 168 | Work currentJob = new Work(); |
171 | m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- Work type: " + currentJob.Type); | 169 | while (true) |
172 | switch (currentJob.Type) | ||
173 | { | 170 | { |
174 | case WorkType.NONE: | 171 | currentJob = m_WorkQueue.Dequeue(); |
175 | break; | 172 | m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- DeQueued a request"); |
176 | case WorkType.OBJECTATTRIBUTECHANGE: | 173 | m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- Work type: " + currentJob.Type); |
177 | ObjectAttributeChanged(model, view, currentJob.LocalId); | 174 | switch (currentJob.Type) |
178 | break; | 175 | { |
179 | case WorkType.PRIMITIVEADDED: | 176 | case WorkType.NONE: |
180 | PrimitiveAdded(model, view, currentJob); | 177 | break; |
181 | break; | 178 | case WorkType.OBJECTATTRIBUTECHANGE: |
182 | case WorkType.OBJECTDUPLICATED: | 179 | ObjectAttributeChanged(model, view, currentJob.LocalId); |
183 | ObjectDuplicated(model, view, currentJob.LocalId); | 180 | break; |
184 | break; | 181 | case WorkType.PRIMITIVEADDED: |
185 | case WorkType.OBJECTKILLED: | 182 | PrimitiveAdded(model, view, currentJob); |
186 | ObjectKilled(model, view, (SceneObjectGroup) currentJob.Data1); | 183 | break; |
187 | break; | 184 | case WorkType.OBJECTDUPLICATED: |
188 | case WorkType.UNDODID: | 185 | ObjectDuplicated(model, view, currentJob.LocalId); |
189 | UndoDid(model, view, currentJob.UUID); | 186 | break; |
190 | break; | 187 | case WorkType.OBJECTKILLED: |
191 | case WorkType.NEWCLIENT: | 188 | ObjectKilled(model, view, (SceneObjectGroup) currentJob.Data1); |
192 | NewClient(view, (IClientAPI) currentJob.Data1); | 189 | break; |
193 | break; | 190 | case WorkType.UNDODID: |
194 | case WorkType.SIMCHAT: | 191 | UndoDid(model, view, currentJob.UUID); |
195 | m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- Message received: " + ((OSChatMessage) currentJob.Data1).Message); | 192 | break; |
196 | SimChat(model, view, (OSChatMessage) currentJob.Data1, channel); | 193 | case WorkType.NEWCLIENT: |
197 | break; | 194 | NewClient(view, (IClientAPI) currentJob.Data1); |
198 | default: | 195 | break; |
199 | m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- uuuuuuuuuh, what?"); | 196 | case WorkType.SIMCHAT: |
200 | break; | 197 | m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- Message received: " + ((OSChatMessage) currentJob.Data1).Message); |
198 | SimChat(model, view, (OSChatMessage) currentJob.Data1, channel); | ||
199 | break; | ||
200 | default: | ||
201 | m_log.Debug("[CONTENT MANAGEMENT] MAIN LOOP -- uuuuuuuuuh, what?"); | ||
202 | break; | ||
203 | } | ||
201 | } | 204 | } |
202 | } | 205 | } |
206 | catch (Exception e) | ||
207 | { | ||
208 | // TODO: Let users in the sim and those entering it and possibly an external watchdog know what has happened | ||
209 | m_log.ErrorFormat( | ||
210 | "[CONTENT MANAGEMENT]: Content management thread terminating with exception. PLEASE REBOOT YOUR SIM - CONTENT MANAGEMENT WILL NOT BE AVAILABLE UNTIL YOU DO. Exception is {0}", | ||
211 | e); | ||
212 | } | ||
203 | } | 213 | } |
204 | 214 | ||
205 | /// <summary> | 215 | /// <summary> |