aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGIncomingSceneObjectEngine.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-11-06 01:15:22 +0000
committerJustin Clark-Casey (justincc)2014-11-25 23:23:11 +0000
commitaeae34505f5f306bbf4d9f3db19db8a26ac5e63d (patch)
tree1a6afdaeb024dc9ffa60cf98e9f53afc1f992c96 /OpenSim/Region/CoreModules/Framework/EntityTransfer/HGIncomingSceneObjectEngine.cs
parentIntroduce an IteratingUuidGatherer where each fetch from the asset service (i... (diff)
downloadopensim-SC_OLD-aeae34505f5f306bbf4d9f3db19db8a26ac5e63d.zip
opensim-SC_OLD-aeae34505f5f306bbf4d9f3db19db8a26ac5e63d.tar.gz
opensim-SC_OLD-aeae34505f5f306bbf4d9f3db19db8a26ac5e63d.tar.bz2
opensim-SC_OLD-aeae34505f5f306bbf4d9f3db19db8a26ac5e63d.tar.xz
When processing incoming attachments via HG, if a request for uuid gathering or final asset import takes too long remove remaining requests from same user to prevent hold up of other user's incoming attachments.
This improves upon the earlier naive simply queueing immplementation. Threshold is 30 seconds. If this happens to a user they can relog and fetch will be reattempted.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGIncomingSceneObjectEngine.cs31
1 files changed, 24 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGIncomingSceneObjectEngine.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGIncomingSceneObjectEngine.cs
index 718db31..ce6cdc9 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGIncomingSceneObjectEngine.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGIncomingSceneObjectEngine.cs
@@ -38,13 +38,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
38{ 38{
39 public class Job 39 public class Job
40 { 40 {
41 public string Name; 41 public string Name { get; private set; }
42 public WaitCallback Callback; 42 public string CommonId { get; private set; }
43 public object O; 43 public WaitCallback Callback { get; private set; }
44 public object O { get; private set; }
44 45
45 public Job(string name, WaitCallback callback, object o) 46 public Job(string name, string commonId, WaitCallback callback, object o)
46 { 47 {
47 Name = name; 48 Name = name;
49 CommonId = commonId;
48 Callback = callback; 50 Callback = callback;
49 O = o; 51 O = o;
50 } 52 }
@@ -90,6 +92,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
90 92
91 public HGIncomingSceneObjectEngine(string name) 93 public HGIncomingSceneObjectEngine(string name)
92 { 94 {
95// LogLevel = 1;
93 Name = name; 96 Name = name;
94 RequestProcessTimeoutOnStop = 5000; 97 RequestProcessTimeoutOnStop = 5000;
95 98
@@ -192,10 +195,24 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
192 } 195 }
193 } 196 }
194 197
195 public bool QueueRequest(string name, WaitCallback req, object o) 198 public Job RemoveNextRequest()
199 {
200 Job nextRequest;
201 m_requestQueue.TryTake(out nextRequest);
202
203 return nextRequest;
204 }
205
206 public bool QueueRequest(string name, string commonId, WaitCallback req, object o)
207 {
208 return QueueRequest(new Job(name, commonId, req, o));
209 }
210
211 public bool QueueRequest(Job job)
196 { 212 {
197 if (LogLevel >= 1) 213 if (LogLevel >= 1)
198 m_log.DebugFormat("[HG INCOMING SCENE OBJECT ENGINE]: Queued job {0}", name); 214 m_log.DebugFormat(
215 "[HG INCOMING SCENE OBJECT ENGINE]: Queued job {0}, common ID {1}", job.Name, job.CommonId);
199 216
200 if (m_requestQueue.Count < m_requestQueue.BoundedCapacity) 217 if (m_requestQueue.Count < m_requestQueue.BoundedCapacity)
201 { 218 {
@@ -203,7 +220,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
203 // "[OUTGOING QUEUE REFILL ENGINE]: Adding request for categories {0} for {1} in {2}", 220 // "[OUTGOING QUEUE REFILL ENGINE]: Adding request for categories {0} for {1} in {2}",
204 // categories, client.AgentID, m_udpServer.Scene.Name); 221 // categories, client.AgentID, m_udpServer.Scene.Name);
205 222
206 m_requestQueue.Add(new Job(name, req, o)); 223 m_requestQueue.Add(job);
207 224
208 if (!m_warnOverMaxQueue) 225 if (!m_warnOverMaxQueue)
209 m_warnOverMaxQueue = true; 226 m_warnOverMaxQueue = true;