Commit Graph

286 Commits (1982d723204500de58443dcd9e620deb4c6b31da)

Author SHA1 Message Date
UbitUmarov f0c865555b add a GetTimeStampMS method, this returns a time stamp in miliSeconds with the resolution avaiable for StopWatchs. Value in double since it can be large (as machine uptime in high resolution ticks) 2015-09-04 11:05:15 +01:00
UbitUmarov a11edceb00 seems to compile ( tests comented out) 2015-09-02 19:54:53 +01:00
UbitUmarov 371c9dd2af bad merge? 2015-09-01 14:54:35 +01:00
UbitUmarov 0edffae7e4 more on tps and crossings 2015-08-30 19:17:35 +01:00
Oren Hurvitz 4ad1468165 Better handling of invalid XML: a) prevent infinite loop on EOF; b) better logging
If the XML was truncated for some reason then ExecuteReadProcessors() would get into an infinite loop, using high CPU. Now it detects EOF (and several other error cases) and aborts.

The rest of the changes just improve logging of XML in case of errors, so that we can see what the bad XML is.
2015-08-11 07:35:37 +01:00
Oren Hurvitz 2153a01cc7 Have osAvatarName2Key check the cache first, even for foreign users
Another change: removed the second call to userManager.AddUser(). UserManagementModule won't modify an existing record.
2015-08-07 11:34:52 +03:00
Oren Hurvitz 83da582261 Removed unused code related to DNS lookups 2015-07-23 14:50:50 +03:00
Cinder 0af17c9484 llListRandomize() wasn't very random
Signed-off-by: Diva Canto <diva@metaverseink.com>
2015-05-27 11:15:09 -07:00
dahlia 8b2af1071f Add NaN and Infinity tests for SOP Velocity and Acceleration setters. 2015-02-16 23:51:37 -08:00
Diva Canto ce1a87b784 Added overloaded LoadArchSpecificWindowsDll, to help addins load native libraries. 2015-01-04 19:06:49 -08:00
Diva Canto 53c8318124 Added utility function that simplifies configuration loading of all addins. 2015-01-03 21:53:18 -08:00
Justin Clark-Casey (justincc) f54c70741b Add "show threadpool calls active" console debug command.
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-25 23:23:10 +00:00
Justin Clark-Casey (justincc) ec8d21c434 Label all threadpool calls being made in core OpenSimulator. This is to add problem diagnosis.
"show threadpool calls" now also returns named (labelled), anonymous (unlabelled) and total call stats.
2014-11-25 23:23:10 +00:00
Justin Clark-Casey (justincc) 72cb1cc7d6 Add "show threadpool calls" command to show count of all labelled smartthreadpool calls 2014-11-25 23:23:10 +00:00
UbitUmarov a301bad8ad on util thread pool reduce the min number of threads, increase the
maximum and increase the idle time before release to OS
2014-10-13 12:10:13 +01:00
Justin Clark-Casey (justincc) 41f2f3132b For monitoring purposes, start non-timeout tasks (which do not currently use 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-09-05 23:20:59 +01:00
Justin Clark-Casey (justincc) 1b75ec5647 Ignore whitespace when reading serialized XML objects.
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-08-29 19:08:23 +01:00
UbitUmarov 3e7f475e58 fix the damm thing 2014-08-12 21:08:01 +01:00
Oren Hurvitz 48d1cca303 Better logging of threadpool activity in Overload mode: if we didn't log "Queue threadfunc" for a particular thread then don't log "Run threadfunc" or "End threadfunc" for that thread either. 2014-07-21 08:30:17 +01:00
Oren Hurvitz 99ac770abb Close streams immediately when we finish using them 2014-07-21 08:30:03 +01:00
Justin Clark-Casey (justincc) 0c8f3dddd8 Use thread-safe version of .NET Random as the SDK class is not thread-safe.
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-14 20:08:11 +01:00
Justin Clark-Casey (justincc) 889194db63 Actually call Close() for shared region modules when the simulator is being shutdown.
Adds regression test for this case.
2014-07-02 23:49:25 +01:00
Melanie a108fcac95 Restore overload mode accidentally disabled in a prior commit. Add a new
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-25 21:34:29 +01:00
Melanie 5dc0298f83 Apply logging flag to a spammy message that may have been overlooked.
No one needs to see every thread launch.....
2014-04-24 01:44:11 +01:00
Oren Hurvitz d1c3f8eef5 Added assets service method AssetsExist(), which returns whether the given 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-04-02 06:30:57 +01:00
Oren Hurvitz 7a47c15edb - Increased the threadpool timeout to 10 minutes
- Changed a few places that launch long-lasting threads to skip the timeout altogether
2014-03-26 20:34:55 +01:00
Oren Hurvitz f901a38204 Improved logging of HTTP requests
- 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-25 09:36:53 +01:00
Oren Hurvitz 4289b71141 Fixed unit tests due to changes in the threadpool 2014-03-25 10:04:52 +02:00
Oren Hurvitz e131e73652 Run slow operations in a separate thread, instead of using FireAndForget (which has a 1-minute timeout)
Resolves http://opensimulator.org/mantis/view.php?id=6945
2014-03-25 08:01:55 +01:00
Oren Hurvitz 84d7227dfd Changed LogThreadPool to have 4 logging levels. Added console command "debug threadpool level" to set the logging level.
Resolves http://opensimulator.org/mantis/view.php?id=6945
2014-03-25 08:01:50 +01:00
Oren Hurvitz b13214af27 Added a watchdog to abort slow threads in the main thread pool
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-25 08:01:45 +01:00
Oren Hurvitz e735f76553 LogThreadPool: when the thread is for ProcessPacketMethod, also log the packet type
Resolves http://opensimulator.org/mantis/view.php?id=6945
2014-03-25 08:01:41 +01:00
Oren Hurvitz 4031933475 Refactored DebugFlagsEnum
Resolves http://opensimulator.org/mantis/view.php?id=6945
2014-03-25 08:01:37 +01:00
Oren Hurvitz 8555e54e22 Automatically start logging FireAndForget activity if the threadpool is full
Resolves http://opensimulator.org/mantis/view.php?id=6945
2014-03-25 08:01:32 +01:00
Oren Hurvitz 7c0ebcb984 Added debug flag: LogThreadPool. It makes us log every use of the main threadpool.
Resolves http://opensimulator.org/mantis/view.php?id=6945
2014-03-25 08:01:13 +01:00
Oren Hurvitz 89945f8829 Refactored: ExternalRepresentationUtils should be the only place where the "CreatorData" field is calculated, to ensure uniformity
Resolves http://opensimulator.org/mantis/view.php?id=6933
2014-03-24 18:00:59 +01:00
Oren Hurvitz 921f0052f4 Get the full viewer name even if it's (incorrectly) sent in the 'Channel' field
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-24 12:26:52 +01:00
Justin Clark-Casey (justincc) cf97535d9e Revert "Simplify DoubleQueue to eliminate redundant sempahore work."
This reverts commit 52b7b40034.

Got the semantics wrong - the sempahore is required so that the blocking thread waits for a signal.
2014-03-19 01:40:56 +00:00
Justin Clark-Casey (justincc) 52b7b40034 Simplify DoubleQueue to eliminate redundant sempahore work.
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-19 00:48:13 +00:00
Justin Clark-Casey (justincc) c605c7a7b7 Lock m_syncRoot on DoubleQueue.Count. This is not documented as a thread-safe operation 2014-03-18 19:54:07 +00:00
Dev Random 6955190c7d Add Util method to load OpSys env vars 2014-02-26 23:39:45 +00:00
Justin Clark-Casey (justincc) 733e067958 Log information about which function, request data and agent ID triggered an XmlRpcGroupsServiceConnector error 2014-02-14 21:28:45 +00:00
Melanie c6e9db5866 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Framework/RegionSettings.cs
	OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
	OpenSim/Region/Framework/Interfaces/IInterregionComms.cs
	OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
2014-01-28 21:02:20 +00:00
Melanie 4ccb15290e Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
	OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
	OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
2014-01-28 20:47:36 +00:00
Robert Adams 4fb3d314b8 Fix casting error for float type INI file parameter parsing. 2014-01-19 07:37:14 -08:00
Robert Adams 08fa0a6a8a Fix casting error for float type INI file parameter parsing. 2014-01-19 07:26:55 -08:00
Justin Clark-Casey (justincc) b5ef585069 Merge branch 'justincc-master' 2014-01-11 01:22:42 +00:00
Oren Hurvitz bc0ff5e7d4 Allow Boolean nodes in XML to be specified as "0/1". AuroraSim does that. 2014-01-11 00:54:41 +00:00
Melanie e79fab91db Intermediate commit. Sill errors.
Merge branch 'master' into careminster

Conflicts:
	OpenSim/Data/SQLite/SQLiteUserProfilesData.cs
	OpenSim/Framework/RegionInfo.cs
	OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs
	OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
	OpenSim/Services/UserProfilesService/UserProfilesService.cs
2014-01-05 20:12:32 +00:00
Robert Adams d9848943a9 Add routines in Util.cs for conversion of region handles to region
locations and for the conversion of region world location to region
'region' location. These routines will replace all the arithmatic
scattered throughout OpenSimulator.
2014-01-04 19:01:03 -08:00