From 2753f4d62c79b45f5ad1b3e275d7a9c628d34687 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 5 Oct 2009 16:06:21 -0700 Subject: * GridServerPostHandler.cs: Try/catch in Handle * BaseOpenSimServer.cs: Added thread pool numbers in show threads --- OpenSim/Framework/Servers/BaseOpenSimServer.cs | 8 +++- .../Server/Handlers/Grid/GridServerPostHandler.cs | 55 ++++++++++++---------- 2 files changed, 38 insertions(+), 25 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 632b551..56155dd 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -238,7 +238,7 @@ namespace OpenSim.Framework.Servers List threads = ThreadTracker.GetThreads(); if (threads == null) { - sb.Append("Thread tracking is only enabled in DEBUG mode."); + sb.Append("OpenSim thread tracking is only enabled in DEBUG mode."); } else { @@ -264,6 +264,12 @@ namespace OpenSim.Framework.Servers } } } + int workers = 0, ports = 0, maxWorkers = 0, maxPorts = 0; + ThreadPool.GetAvailableThreads(out workers, out ports); + ThreadPool.GetMaxThreads(out maxWorkers, out maxPorts); + + sb.Append(Environment.NewLine + "*** ThreadPool threads ***" + Environment.NewLine); + sb.Append("workers: " + (maxWorkers - workers) + " (" + maxWorkers + "); ports: " + (maxPorts - ports) + " (" + maxPorts + ")" + Environment.NewLine); return sb.ToString(); } diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs index 17a31bc..433ed0b 100644 --- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs @@ -67,43 +67,50 @@ namespace OpenSim.Server.Handlers.Grid //m_log.DebugFormat("[XXX]: query String: {0}", body); - Dictionary request = - ServerUtils.ParseQueryString(body); + try + { + Dictionary request = + ServerUtils.ParseQueryString(body); - if (!request.ContainsKey("METHOD")) - return FailureResult(); + if (!request.ContainsKey("METHOD")) + return FailureResult(); - string method = request["METHOD"]; + string method = request["METHOD"]; - switch (method) - { - case "register": - return Register(request); + switch (method) + { + case "register": + return Register(request); - case "deregister": - return Deregister(request); + case "deregister": + return Deregister(request); - case "get_neighbours": - return GetNeighbours(request); + case "get_neighbours": + return GetNeighbours(request); - case "get_region_by_uuid": - return GetRegionByUUID(request); + case "get_region_by_uuid": + return GetRegionByUUID(request); - case "get_region_by_position": - return GetRegionByPosition(request); + case "get_region_by_position": + return GetRegionByPosition(request); - case "get_region_by_name": - return GetRegionByName(request); + case "get_region_by_name": + return GetRegionByName(request); - case "get_regions_by_name": - return GetRegionsByName(request); + case "get_regions_by_name": + return GetRegionsByName(request); - case "get_region_range": - return GetRegionRange(request); + case "get_region_range": + return GetRegionRange(request); + } + m_log.DebugFormat("[GRID HANDLER]: unknown method {0} request {1}", method.Length, method); + } + catch (Exception e) + { + m_log.DebugFormat("[GRID HANDLER]: Exception {0}", e); } - m_log.DebugFormat("[GRID HANDLER]: unknown method {0} request {1}", method.Length, method); return FailureResult(); } -- cgit v1.1