aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs (unfollow)
Commit message (Collapse)AuthorFilesLines
2015-02-16Add NaN and Infinity tests for SOP Velocity and Acceleration setters.dahlia1-0/+16
2015-01-04Added overloaded LoadArchSpecificWindowsDll, to help addins load native ↵Diva Canto1-2/+7
libraries.
2015-01-03Added utility function that simplifies configuration loading of all addins.Diva Canto1-0/+57
2014-11-25Add "show threadpool calls active" console debug command.Justin Clark-Casey (justincc)1-1/+27
This shows named threadpool calls (excluding timer and network calls) that are currently queued or running. Also shows total of labelled and any anonymous calls.
2014-11-25Label all threadpool calls being made in core OpenSimulator. This is to add ↵Justin Clark-Casey (justincc)1-10/+13
problem diagnosis. "show threadpool calls" now also returns named (labelled), anonymous (unlabelled) and total call stats.
2014-11-25Add "show threadpool calls" command to show count of all labelled ↵Justin Clark-Casey (justincc)1-1/+15
smartthreadpool calls
2014-09-05For monitoring purposes, start non-timeout tasks (which do not currently use ↵Justin Clark-Casey (justincc)1-30/+0
a threadpool) via Watchdog.RunInThread() rather than Util.RunThreadNoTimeout() The functionality is the same but this allow us to monitor such tasks via "show threads" and abort them for test purposes, etc. Also extends thread names to provide more info (e.g. SendInitialDataToClient says what client the task is for).
2014-08-29Ignore whitespace when reading serialized XML objects.Justin Clark-Casey (justincc)1-5/+5
This was previously effectively being done by XmlDocument in the multiple passes through the XML. This change tells XmlReader to ignore whitespace. This also means changing arguments to use XmlReader instead of XmlTextReader (a descendent of XmlReader) directly. XmlReader.Create() has been the recommend way to create XML readers since .NET 2.0 as per MS SDK and is the only way to specific ignore whitespace settings.
2014-07-21Better logging of threadpool activity in Overload mode: if we didn't log ↵Oren Hurvitz1-1/+7
"Queue threadfunc" for a particular thread then don't log "Run threadfunc" or "End threadfunc" for that thread either.
2014-07-21Close streams immediately when we finish using themOren Hurvitz1-40/+13
2014-07-14Use thread-safe version of .NET Random as the SDK class is not thread-safe.Justin Clark-Casey (justincc)1-1/+1
As per http://msdn.microsoft.com/en-us/library/system.random%28v=vs.100%29.aspx, the .NET Random class is not thread-safe. If called by multiple threads at once, methods may return 0. Except for llRand(), other OpenSimulator code did not lock before calling a shared Random instance. This commit adds a ThreadSafeRandom class that extends Random but does internal locking so that it is thread-safe. This change is invisible to existing callers and the explicit locking in the llFrand() implementation is now redundant.
2014-07-02Actually call Close() for shared region modules when the simulator is being ↵Justin Clark-Casey (justincc)1-1/+6
shutdown. Adds regression test for this case.
2014-04-25Restore overload mode accidentally disabled in a prior commit. Add a newMelanie1-2/+4
config option, LogOverloads, to log when a thread pool overload occurs. This option defaults to "True" because the logging data is useful for diagnosing threading issues.
2014-04-24Apply logging flag to a spammy message that may have been overlooked.Melanie1-1/+1
No one needs to see every thread launch.....
2014-04-02Added assets service method AssetsExist(), which returns whether the given ↵Oren Hurvitz1-0/+50
list of assets exist. This method is used to optimize sending assets with embedded assets: e.g., when a Hypergrid visitor takes an item into the inventory.
2014-03-26- Increased the threadpool timeout to 10 minutesOren Hurvitz1-1/+1
- Changed a few places that launch long-lasting threads to skip the timeout altogether
2014-03-25Improved logging of HTTP requestsOren Hurvitz1-0/+40
- MemoryBuffer isn't seekable, so we can't log it. Log the string instead. - Handle compressed streams - Don't attempt to dump binary data. Either don't log it at all (if we know it's binary), or at least convert non-ASCII characters to ASCII. - Log responses to HTTP requests - Use the same log prefix for all of these log messages ("[LOGHTTP]"), to make them easy to see at a glance - Increased the snippet length to 200 (80 doesn't show enough), and add "..." only if the message was actually truncated Resolves http://opensimulator.org/mantis/view.php?id=6949
2014-03-25Fixed unit tests due to changes in the threadpoolOren Hurvitz1-8/+19
2014-03-25Run slow operations in a separate thread, instead of using FireAndForget ↵Oren Hurvitz1-0/+23
(which has a 1-minute timeout) Resolves http://opensimulator.org/mantis/view.php?id=6945
2014-03-25Changed LogThreadPool to have 4 logging levels. Added console command "debug ↵Oren Hurvitz1-19/+40
threadpool level" to set the logging level. Resolves http://opensimulator.org/mantis/view.php?id=6945
2014-03-25Added a watchdog to abort slow threads in the main thread poolOren Hurvitz1-11/+269
If a task in the thread pool hangs then it will permanently take up one of the threads. If this happens repeatedly then the thread pool will become exhausted and OpenSim will fail. This watchdog terminates threads in the thread pool that have been executing for over a minute (which probably means they're hung). Resolves http://opensimulator.org/mantis/view.php?id=6945
2014-03-25LogThreadPool: when the thread is for ProcessPacketMethod, also log the ↵Oren Hurvitz1-3/+12
packet type Resolves http://opensimulator.org/mantis/view.php?id=6945
2014-03-25Refactored DebugFlagsEnumOren Hurvitz1-5/+14
Resolves http://opensimulator.org/mantis/view.php?id=6945
2014-03-25Automatically start logging FireAndForget activity if the threadpool is fullOren Hurvitz1-4/+19
Resolves http://opensimulator.org/mantis/view.php?id=6945
2014-03-25Added debug flag: LogThreadPool. It makes us log every use of the main ↵Oren Hurvitz1-29/+114
threadpool. Resolves http://opensimulator.org/mantis/view.php?id=6945
2014-03-24Refactored: ExternalRepresentationUtils should be the only place where the ↵Oren Hurvitz1-2/+7
"CreatorData" field is calculated, to ensure uniformity Resolves http://opensimulator.org/mantis/view.php?id=6933
2014-03-24Get the full viewer name even if it's (incorrectly) sent in the 'Channel' fieldOren Hurvitz1-0/+32
Recent versions of Firestorm and Singularity have started sending the viewer name in the 'Channel' field, leaving only their version number in the 'Viewer' field. So we need to search both of these fields for the viewer name. This resolves http://opensimulator.org/mantis/view.php?id=6952
2014-03-19Revert "Simplify DoubleQueue to eliminate redundant sempahore work."Justin Clark-Casey (justincc)1-7/+27
This reverts commit 52b7b40034ddbb21d06b11ddc4eb6d766b0f616d. Got the semantics wrong - the sempahore is required so that the blocking thread waits for a signal.
2014-03-19Simplify DoubleQueue to eliminate redundant sempahore work.Justin Clark-Casey (justincc)1-27/+7
Exclusion is already guaranteed by the lock on m_syncRoot. Semaphore could not allow more than one thread in these sections anyway since the underlying SDK structures are not thread-safe.
2014-03-18Lock m_syncRoot on DoubleQueue.Count. This is not documented as a ↵Justin Clark-Casey (justincc)1-1/+5
thread-safe operation
2014-02-26Add Util method to load OpSys env varsDev Random1-83/+87
2014-02-14Log information about which function, request data and agent ID triggered an ↵Justin Clark-Casey (justincc)1-0/+24
XmlRpcGroupsServiceConnector error
2014-01-19Fix casting error for float type INI file parameter parsing.Robert Adams1-1/+1
2014-01-19Fix casting error for float type INI file parameter parsing.Robert Adams1-1/+1
2014-01-11Allow Boolean nodes in XML to be specified as "0/1". AuroraSim does that.Oren Hurvitz1-1/+3
2014-01-04Add routines in Util.cs for conversion of region handles to regionRobert Adams1-0/+43
locations and for the conversion of region world location to region 'region' location. These routines will replace all the arithmatic scattered throughout OpenSimulator.
2013-12-26varregion: many more updates removing the constant RegionSize and replacingRobert Adams1-0/+5
with a passed region size. This time in the map code and grid services code.
2013-11-28varregion: many replacements of in-place arithmetic with calls toRobert Adams1-0/+1
the Util functions for converting world addresses to region addresses and converting region handles to locations.
2013-11-08varregion: elimination of Constants.RegionSize from all over OpenSimulator.Robert Adams1-0/+37
Routines in Util to compute region world coordinates from region coordinates as well as the conversion to and from region handles. These routines have replaced a lot of math scattered throughout the simulator. Should be no functional changes.
2013-09-03minor simplification of some unix date functions in Util. No functional change.Justin Clark-Casey (justincc)1-5/+3
2013-09-03Add experimental "show grid users online" console command to show grid users ↵Justin Clark-Casey (justincc)1-4/+4
online from a standalone/robust instance. This is not guaranteed to be accurate since users may be left "online" in certain situations. For example, if a simulator crashes and they never login/logout again. To counter this somewhat, only users continuously online for less than 5 days are shown.
2013-08-08Fixed error in BuildFakeParcelID() which was detected by regression tests.Kevin Cozens1-2/+2
2013-07-18Added MinPoolThreads to ini [Startup] section to control SmartThreadPool.Dan Lake1-3/+5
2013-07-18Fix what apepars to be a bug in DoubleQueue<T>.Enqueue(Queue<T> q, T data) ↵Justin Clark-Casey (justincc)1-1/+1
where the q parmater is ignored and everyghig is always placed on m_lowQueue. No actual impact presently since nothing ends up calling EnqueueHigh()
2013-07-15This might address the following observed exception:Diva Canto1-1/+1
17:14:28 - [APPLICATION]: APPLICATION EXCEPTION DETECTED: System.UnhandledExceptionEventArgs Exception: System.InvalidOperationException: Operation is not valid due to the current state of the object at System.Collections.Generic.Queue`1[OpenSim.Region.ClientStack.Linden.WebFetchInvDescModule+aPollRequest].Peek () [0x00011] in /root/install/mono-3.1.0/mono/mcs/class/System/System.Collections.Generic/Queue.cs:158 at System.Collections.Generic.Queue`1[OpenSim.Region.ClientStack.Linden.WebFetchInvDescModule+aPollRequest].Dequeue () [0x00000] in /root/install/mono-3.1.0/mono/mcs/class/System/System.Collections.Generic/Queue.cs:140 at OpenSim.Framework.DoubleQueue`1[OpenSim.Region.ClientStack.Linden.WebFetchInvDescModule+aPollRequest].Dequeue (TimeSpan wait, OpenSim.Region.ClientStack.Linden.aPollRequest& res) [0x0004e] in /home/avacon/opensim_2013-07-14/OpenSim/Framework/Util.cs:2297
2013-07-11Fix regression where llHTTPRequests which did not get an OK response ↵Justin Clark-Casey (justincc)1-1/+6
returned 499 and the exception message in the http_response event rather than the actual response code and body. This was a regression since commit 831e4c3 (Thu Apr 4 00:36:15 2013) This commit also adds a regression test for this case, though this currently only works with Mono This aims to address http://opensimulator.org/mantis/view.php?id=6704
2013-06-17refactor: Move existing code to generate report information on the ↵Justin Clark-Casey (justincc)1-63/+41
threadpool to the ServerBase rather than being in Util
2013-06-17Fix bug where no threadpool data would be displayed in the "show threads" ↵Justin Clark-Casey (justincc)1-1/+1
command if threadpool type was QueueUserWorkItem (Unsafe worked as expected)
2013-06-05Port Avination's inventory send throttlingMelanie1-0/+108
2013-05-21To further help with tracking down the apperance of too much "Unknown User" ↵Justin Clark-Casey (justincc)1-1/+1
in chatlogs, etc. temporarily change each instance of this in OpenSimulator so we can identify where it's coming from For instance, the "Unknown User" in Util.ParseUniversalUserIdenitifer becaomes "Unknown UserUPUUI (class initials + method initials) This is to help with http://opensimulator.org/mantis/view.php?id=6625