From 67fa6577461bf1e2a39c501f73d8bfc9045ee69e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 26 Sep 2012 04:52:19 +0100 Subject: [PATCH 1/3] keep watchdog happy using it to kill his threads --- .../Servers/HttpServer/PollServiceRequestManager.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index c234537794..cc9ddc2cca 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs @@ -278,15 +278,7 @@ namespace OpenSim.Framework.Servers.HttpServer Thread.Sleep(1000); // let the world move foreach (Thread t in m_workerThreads) - { - try - { - t.Abort(); - } - catch - { - } - } + Watchdog.AbortThread(t.ManagedThreadId); try { From abb4b9fcae6f8091774325615a37e4e44351b9a6 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 26 Sep 2012 15:11:59 +0100 Subject: [PATCH 2/3] UriModule GetEvents also doesn't need a request body --- OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index 13762f7993..d4a48322fb 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs @@ -186,6 +186,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp PollServiceEventArgs args = new PollServiceEventArgs(HttpRequestHandler, HasEvents, GetEvents, NoEvents, urlcode, 25000); args.Type = PollServiceEventArgs.EventType.LslHttp; + args.GetEventsNeedsRequest = false; m_HttpServer.AddPollServiceHTTPHandler(uri, args); // m_log.DebugFormat( From 7e3eba1064197024690c5b3cae4c2cf87319e48c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 26 Sep 2012 15:41:57 +0100 Subject: [PATCH 3/3] Seems nothing actually need the request body for getevents. so change control flag to false --- .../Servers/HttpServer/PollServiceEventArgs.cs | 10 ++++++++-- .../Servers/HttpServer/PollServiceRequestManager.cs | 3 ++- .../ClientStack/Linden/Caps/GetTextureModule.cs | 12 ++---------- .../ClientStack/Linden/Caps/WebFetchInvDescModule.cs | 1 - .../CoreModules/Scripting/LSLHttp/UrlModule.cs | 1 - 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs index 9b27a6e05d..f85509a8e6 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs @@ -46,8 +46,14 @@ namespace OpenSim.Framework.Servers.HttpServer public RequestMethod Request; public UUID Id; public int TimeOutms; - public EventType Type; - public bool GetEventsNeedsRequest = true; + public EventType Type; + // must be set true for cases where GetEvents needs to access the request body + // at each pool. http can start processing before having the full body + // but not sure if this is active for poll events + // if original coder thinked its needed i keep it + // if the Event has a Request method this seems to smoke for now + // seems for now nothing actually uses this so default to false + public bool GetEventsNeedsRequestBody = false; public enum EventType : int { diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index cc9ddc2cca..c379747fa7 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs @@ -337,10 +337,11 @@ namespace OpenSim.Framework.Servers.HttpServer if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id)) { string strreq = ""; - if (req.PollServiceArgs.GetEventsNeedsRequest) + if (req.PollServiceArgs.GetEventsNeedsRequestBody) { try { + // should we try to seek back? fear we can't str = new StreamReader(req.Request.Body); strreq = str.ReadToEnd(); str.Close(); diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs index 8a607fb3dc..5169f65453 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs @@ -151,12 +151,7 @@ namespace OpenSim.Region.ClientStack.Linden private Scene m_scene; public PollServiceTextureEventArgs(UUID pId, Scene scene) : - base(null, null, null, null, pId, int.MaxValue) - // this should never timeout - // each request must be processed and return a response - // noevents can possible be use for nice shutdown, but not sure now - // the execution will provide a proper response even if it fails - + base(null, null, null, null, pId, int.MaxValue) { m_scene = scene; @@ -219,7 +214,6 @@ namespace OpenSim.Region.ClientStack.Linden UUID requestID = requestinfo.reqID; // If the avatar is gone, don't bother to get the texture - if (m_scene.GetScenePresence(Id) == null) { response = new Hashtable(); @@ -246,12 +240,10 @@ namespace OpenSim.Region.ClientStack.Linden { string capUrl = "/CAPS/" + UUID.Random() + "/"; - // Register this as a poll service - // absurd large timeout to tune later to make a bit less than viewer + // Register this as a poll service PollServiceTextureEventArgs args = new PollServiceTextureEventArgs(agentID, m_scene); args.Type = PollServiceEventArgs.EventType.Texture; - args.GetEventsNeedsRequest = false; MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args); string hostName = m_scene.RegionInfo.ExternalHostName; diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index 56070c6ccb..0f305b117b 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs @@ -223,7 +223,6 @@ namespace OpenSim.Region.ClientStack.Linden PollServiceInventoryEventArgs args = new PollServiceInventoryEventArgs(agentID); args.Type = PollServiceEventArgs.EventType.Inventory; - args.GetEventsNeedsRequest = false; MainServer.Instance.AddPollServiceHTTPHandler(capUrl, args); string hostName = m_scene.RegionInfo.ExternalHostName; diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index d4a48322fb..13762f7993 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs @@ -186,7 +186,6 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp PollServiceEventArgs args = new PollServiceEventArgs(HttpRequestHandler, HasEvents, GetEvents, NoEvents, urlcode, 25000); args.Type = PollServiceEventArgs.EventType.LslHttp; - args.GetEventsNeedsRequest = false; m_HttpServer.AddPollServiceHTTPHandler(uri, args); // m_log.DebugFormat(