Commit Graph

363 Commits (df7468ffa27b46f074b0f9c6d6c7be4e09164c88)

Author SHA1 Message Date
Justin Clark-Casey (justincc) ca26ff9436 minor: remove some mono compile warnings in XEngine.cs 2013-01-29 03:58:11 +00:00
Melanie be4c8c4931 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
2013-01-24 00:25:08 +00:00
Justin Clark-Casey (justincc) 55c6753b13 Merge branch 'master' into cooptermination 2013-01-24 00:03:44 +00:00
Justin Clark-Casey (justincc) 72dd3633ee Improve logging by making it clearer which script is failing if an assembly fails to load.
Moves the noise co-op start/stop debug log messages to only display if xengine debug level >= 1
Logs which stop strategy is being used (abort or co-op)
Adjusts some other logging to remove not very useful stuff
2013-01-23 23:34:15 +00:00
Melanie cc4cfd9fa8 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
	OpenSim/Region/Physics/BulletSNPlugin/BSShapeCollection.cs
2013-01-23 02:38:59 +00:00
Justin Clark-Casey (justincc) cf168194e5 If ScriptStopStrategy hasn't been set to co-op in [XEngine] config, then continue to generate C# that is functionality identical to historical generation
This is to eliminate disruption until co-op termination has been well-tested.
In non co-op mode, XEngine will continue to load DLLs of the existing Script class and the new XEngineScript class.
Moving to co-op mode still requires existing script DLL deletion to force recompilation, either manually or by setting DeleteScriptsOnStartup = true for one run.
This change also means that scripts which fail to initialize do not still show up as running scripts.
2013-01-23 02:36:43 +00:00
Justin Clark-Casey (justincc) 1730de14a4 minor: comment out Console.WriteLine debugging message in XEngine 2013-01-22 01:00:53 +00:00
Oren Hurvitz b77da5039e Assign the SmartThreadPool name in the constructor
This is required because some threads are created in the constructor, so assigning the name afterwards would be too late.
2013-01-19 02:08:58 +00:00
Justin Clark-Casey (justincc) c8afc8523b Implement non-wait co-operative termination of scripts for XEngine in addition to termination on wait.
This involves inserting opensim_reserved_CheckForCoopTermination() calls in lsl -> c# translation at any place where the script could be in a loop with no wait calls.
These places are for, while, do-while, label, user function call and manual event function call.
Call goes through to an XEngineScriptBase which extends ScriptBase.
IEngine is extended to supply necessary engine-specific parent class references and constructor parameters to Compiler.
Unfortunately, since XEngineScriptBase has to be passed WaitHandle in its constructor, older compiled scripts will fail to load with an error on the OpenSim console.
Such scripts will need to be recompiled, either by removing all *.dll files from the bin/ScriptEngines/<region-id> or by setting DeleteScriptsOnStartup = true in [XEngine] for one run.
Automatic recompilation may be implemented in a later commit.
This feature should not yet be used, default remains termination with Thread.Abort() which will work as normal once scripts are recompiled.
2013-01-17 23:39:09 +00:00
Melanie 818254916c JustinCC's core re-merge 2013-01-16 15:47:55 +00:00
Justin Clark-Casey (justincc) 0963ece25b Implement co-operative script termination if termination comes during a script wait event (llSleep(), etc.)
This makes use of EventWaitHandles since various web references indicate that Thread.Interrupt() can also cause runtime instability.
If co-op termination is enabled, then termination sets the wait handle instead of waiting for a timeout before possibly aborting the thread.
This allows the script to cleanly terminate if it's in a llSleep/LL function delay or the next time it enters such a wait without any timeout period.
Co-op termination is not yet testable since checking for termination request within loops that never trigger a wait is not yet implemented.
This commit, unlike 1b5c41c, passes the wait handle as an extra parameter through IScript.Initialize() instead of passing IScriptInstance itself.
2013-01-16 02:07:43 +00:00
Justin Clark-Casey (justincc) b8949024bc Revert "Implement co-operative script termination if termination comes during a script wait event (llSleep(), etc.)"
Doing this as a favour to Melanie.  This will be back with passing the wait handles directly to the api.

This reverts commit 1b5c41c14a.
2013-01-16 01:45:09 +00:00
Justin Clark-Casey (justincc) 1b5c41c14a Implement co-operative script termination if termination comes during a script wait event (llSleep(), etc.)
This makes use of EventWaitHandles since various web references indicate that Thread.Interrupt() can also cause runtime instability.
If co-op termination is enabled, then termination sets the wait handle instead of waiting for a timeout before possibly aborting the thread.
This allows the script to cleanly terminate if it's in a llSleep/LL function delay or the next time it enters such a wait without any timeout period.
Co-op termination is not yet testable since checking for termination request within loops that never trigger a wait is not yet implemented.
2013-01-16 00:12:40 +00:00
Justin Clark-Casey (justincc) fccb03227e Instead of passing separate engine, part and item components to script APIs, pass down IScriptInstance instead.
This is to allow the future co-operative script thread terminate feature to detect and act upon termination requests.
This splits the assembly and state loading out from the ScriptInstance() constructor to a separate Load() method
in order to facilititate continued script logic regression testing.
2013-01-15 21:13:22 +00:00
Melanie 3a495ccd56 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Timer.cs
	OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
2013-01-10 01:38:03 +00:00
Justin Clark-Casey (justincc) a0000a034f Add "show sensors" command to show script sensor information for debug purposes. 2013-01-10 00:32:22 +00:00
Justin Clark-Casey (justincc) 3d5e3e35b7 minor: Fix command match of "debug script" command to "debug scripts" to match other scripts commands (and it's own short help text) 2013-01-09 00:08:08 +00:00
Justin Clark-Casey (justincc) 5fa4b8b144 minor: Allow "script *" console commands to take multiple script item ids 2013-01-09 00:01:48 +00:00
Melanie 7943c8d11c Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
2013-01-02 11:52:37 +00:00
Justin Clark-Casey (justincc) bc9a7ba0d6 minor: Assign names to the different SmartThreadPools for debugging purposes.
A different approach to the patch in http://opensimulator.org/mantis/view.php?id=6462
that doesn't involve further forking of SmartThreadPool
2013-01-01 23:57:20 +00:00
Melanie caea7601cb Merge branch 'master' into careminster 2012-12-18 09:45:40 +00:00
Justin Clark-Casey (justincc) e6fd8365af Extend default 1 second wait for event completion to other thread script reset (as called by llResetOtherScript()).
As with script stop (via llDie()) aborting other scripts event threads, llResetOtherScript() can also abort any current event thread on another script.
On mono 2.6, 2.10 and possibly later this may cause locking problems in certain code areas.
This commit reuses the recently introduced [XEngine] WaitForEventCompletionOnScriptStop to make this a 1 sec timeout, rather than 0 secs.
2012-12-17 21:37:02 +00:00
Melanie 0a876a305c Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
	OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
2012-12-16 21:19:30 +00:00
Justin Clark-Casey (justincc) 523213060b Add WaitForEventCompletionOnScriptStop [XEngine] config param to OpenSimDefaults.ini to allow change of the wait time for an event to complete on script removal before aborting its thread
Default is 1000, as has previously been the case.
This parameter exists for further debug work concerning mono 2.10 crashes that may be related to locks not being removed on Thread.Abort
2012-12-13 23:21:25 +00:00
Justin Clark-Casey (justincc) 047270bdc8 Add "debug script log" command to allow setting a numeric debug level on individual IScriptInstances for debugging purposes.
Current, state changes and event fires can be logged for individual scripts.
See command help for more details.
2012-12-12 23:13:34 +00:00
Justin Clark-Casey (justincc) 418c0cb01d Add asset id to "show script" and "show scripts" command output to make it easier to extract and inspect the script's asset via "dump asset" 2012-12-12 22:06:09 +00:00
Melanie 2cb824d3fc Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
	OpenSim/Region/Framework/Scenes/Scene.cs
2012-12-07 03:49:04 +00:00
Justin Clark-Casey (justincc) ec765de7e5 Add engine-wide events queued and events processed numbers to output of "xengine status" console command. For debugging purposes. 2012-12-05 23:41:50 +00:00
Justin Clark-Casey (justincc) 5ba99cbf55 Add IScriptInstance.EventsQueued to match EventsProcessed instead of asking callers to lock and directly inspect the EventQueue 2012-12-05 23:33:48 +00:00
Justin Clark-Casey (justincc) 652f4bcb42 For now, sort "show scripts" output in descending order sorted by events processed.
For debug purposes - should later add options to allow different sorting or show only highest 10, etc.
2012-12-05 23:27:50 +00:00
Justin Clark-Casey (justincc) e8df0f1b4c Add IScriptInstance.EventsProcessed stat so that we can record this information and display in "show scripts" for debug purposes 2012-12-05 22:33:46 +00:00
Justin Clark-Casey (justincc) ea786414c2 In XEngine.DoOnRezScript() use Culture.SetCurrentCulture() instead of constructing a new CultureInfo separately 2012-12-05 21:51:08 +00:00
Justin Clark-Casey (justincc) d97440c7cf On XEngine.ProcessEventHandler(), instead of creating a new CultureInfo on every call use the single one set by Culture.SetCurrentCulture()
This is slightly different in that SetCurrentCulture() does not use overridden settings if the system culture matches en-US but some settings there have been changed.
This is what we want - we do not want to use any system overriden settings.
2012-12-05 21:40:28 +00:00
Melanie 007a45aa76 Merge commit 'a0d178b284050df64d0eb5b9728565fd72615c22' into careminster 2012-08-25 18:08:10 +01:00
Justin Clark-Casey (justincc) f3a5e3a02b Log initial script startup info notice when xengine actually starts to do this for debugging purposes, rather than before it actually starts to do this. 2012-08-25 00:42:32 +01:00
Melanie 783773a0c0 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
2012-08-24 00:07:17 +01:00
Justin Clark-Casey (justincc) aede42b875 If a script state save fails for some reason on shutdown/region removal, get xengine to spit out some useful information and continue to save other script states 2012-08-23 23:13:53 +01:00
Melanie 914f97cb76 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
2012-08-18 19:01:05 +01:00
SignpostMarv ffdde05bb7 constructor means not having to manually refer to individual properties 2012-08-18 18:29:59 +01:00
Melanie 5d43e27de2 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
2012-08-18 13:57:50 +01:00
SignpostMarv 5d7751da89 refactoring for Vector3 operator & constructor tweaks 2012-08-18 13:21:55 +01:00
Melanie aee7a31bc3 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/Scene.cs
	OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
	OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
2012-08-18 13:17:39 +01:00
Justin Clark-Casey (justincc) 0860a0d856 minor: Make xengine debug message on script load a scripting loading message instead.
This is more useful if compilation fails due to an uncatchable exception since we know what was being compiled.
2012-08-17 22:30:01 +01:00
Melanie 771d79e83e Merge branch 'master' into careminster
Conflicts:
	OpenSim/Framework/Monitoring/BaseStatsCollector.cs
	OpenSim/Region/Application/OpenSim.cs
	OpenSim/Region/Application/OpenSimBase.cs
	OpenSim/Region/Framework/Scenes/SceneManager.cs
	bin/OpenMetaverse.Rendering.Meshmerizer.dll
	bin/OpenMetaverse.StructuredData.dll
	bin/OpenMetaverse.dll
	bin/OpenMetaverseTypes.dll
	prebuild.xml
2012-07-28 00:39:36 +01:00
Justin Clark-Casey (justincc) 31304c222d Make SceneManager.OnRegionsReadyStatusChange event available.
This is fired when all regions are ready or when at least one region becomes not ready.
Recently added EventManager.OnRegionReady becomes OnRegionReadyStatusChange to match OnLoginsEnabledStatusChange
2012-07-25 21:00:59 +01:00
Melanie 36d744e2a5 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
	OpenSim/Region/Framework/Scenes/Scene.cs
	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
	OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
2012-07-19 09:47:51 +01:00
Justin Clark-Casey (justincc) 1971b6bb4f Stop the 15 second initial script compile wait if a script is being rezzed on a previously empty region. 2012-07-18 22:24:52 +01:00
Melanie c489bc1cd2 Make the scrpt running flag work properly 2012-07-17 15:00:42 +02:00
Melanie 8204976fb4 Merge branch 'master' into careminster 2012-07-16 23:34:52 +01:00
Melanie 1c3b0da74a Revert "Fix script "Running" behavior"
A better solution using the already present flags must be found.

This reverts commit 6d3ee8bb39.
2012-07-16 23:31:55 +01:00
Melanie d632fd7124 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
	OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
	OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
	OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
2012-07-12 08:55:16 +01:00
Justin Clark-Casey (justincc) 916e3bf886 Where possible, use the system Encoding.ASCII and Encoding.UTF8 rather than constructing fresh copies.
The encodings are thread-safe and already used in such a manner in other places.
This isn't done where Byte Order Mark output is suppressed, since Encoding.UTF8 is constructed to output the BOM.
2012-07-11 22:54:22 +01:00
Justin Clark-Casey (justincc) 33cff9b9d7 Allow XEngine StartDelay to be configured in the [XEngine] config section.
This is only currently meant for use by regression tests that don't have any issues if XEngine is started up quickly, since no other operations will be occuring simultaneously.
Therefore, this is not yet documented externally.
2012-07-11 21:55:18 +01:00
Justin Clark-Casey (justincc) fc24563206 Add regression TestDetachScriptedAttachmentToInventory()
This currently only does a relatively crude check for a ScriptState node in the serialized xml
2012-07-11 21:43:35 +01:00
Melanie 89c9528e38 Merge branch 'avination' into careminster
Conflicts:
	OpenSim/Data/MySQL/MySQLSimulationData.cs
2012-07-11 14:27:33 +01:00
Melanie 0bc8238a6c Merge branch 'master' into careminster
Conflicts:
	OpenSim/Framework/Watchdog.cs
	OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
	OpenSim/Region/Framework/Scenes/Scene.cs
	OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
	OpenSim/Region/Framework/Scenes/ScenePresence.cs
2012-07-11 03:56:50 +01:00
Justin Clark-Casey (justincc) eb5ec4a786 If a script is being stopped manually, then give the scriptpool thread 1 second to finish normally before forcibly aborting.
This is to avoid the worst of the problems in mono 2.6, 2.10 where an aborted thread does not always release all its locks.
This very short grace period is identical to the existing behaviour when a script is removed from the scene.
2012-07-10 21:42:51 +01:00
UbitUmarov 6b8b7007c4 console region restart: Let Xengine not cry all over the place with
errors also. May not be that good, but is not in use in AVN (i hope). Still safer to do a full shutdown and refire the region from a OS tool like a script, monit, etc etc
2012-07-10 18:23:38 +01:00
Melanie d32cf21576 Add preservation of running state of scripts when drag-copying. 2012-07-01 18:30:59 +01:00
Melanie 6137f37028 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
	OpenSim/Region/Framework/Scenes/Scene.cs
2012-06-29 22:24:53 +01:00
Justin Clark-Casey (justincc) 972b0b52f9 If rest of first line after colon is blank then still warn about running in XEngine if engine specified does not exist.
This is to take account of situations where the user was intending to specify a script engine using colon using its default language.
This probably generates few false positive as scripts are less likely to end a first line colon with a comment for other purposes.
2012-06-28 21:30:36 +01:00
Melanie 41a1903c60 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
2012-06-28 03:21:08 +01:00
Justin Clark-Casey (justincc) 25baa2d894 Avoid reporting false positives when a colon is in a comment in the first line of a script where the user was not trying to select a different script engine.
This works by only posting the "Selected engine unavailable" message if we're falling back on XEngine and the language is one handled by XEngine.
In cases where the language is not handled or not allowed, the user will still be notified by the later compiler error.
This avoids the overwhelming majority of false positives where the first line contains a : for other reasons (e.g. source control systems, vim settings, etc.)
Ultimately, I think it would be better to detect script language/engine with a mechanism that didn't just rely on : detection (e.g like #! in unix scripts).
2012-06-28 01:01:18 +01:00
Justin Clark-Casey (justincc) f9769a9fcb minor: reuse colon index calculation in XEngine.OnRezScript. The index if a colon is found on the first line will always be the same as for the whole script. 2012-06-28 00:37:23 +01:00
Melanie 7cc5b3d7d3 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
	OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
	OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
2012-06-26 17:35:55 +01:00
BlueWall 6d3ee8bb39 Fix script "Running" behavior
Unchecking "Running" box in script editor now persists. This fixes http://opensimulator.org/mantis/view.php?id=6057
2012-06-23 04:15:14 -04:00
Justin Clark-Casey (justincc) 80a41e670d Avoid race condition between m_PrimObjects iteration in XEngine.PostObjectEvent and places where the list is modified by extending the m_PrimObjects lock. 2012-06-22 02:23:25 +01:00
Justin Clark-Casey (justincc) 9f3feeff8d If starting scripts on initial sim start, provide INFO level log feedback each time 50 scripts have been started.
This is to provide an indication of what's happening now that the default isn't to report every single script start.
Changes XEngine logging level in OpenSim.exe.config from WARN to INFO.
2012-06-22 02:10:27 +01:00
Justin Clark-Casey (justincc) f907182ab2 Eliminate unnecessary extra call to TriggerEmptyScriptCompileQueue in XEngine.DoOnRezScriptQueue()
The later invocation of this function will happen on an empty compile queue.
2012-06-22 01:57:14 +01:00
Melanie eab211f94d Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
	OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
	OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
	OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
2012-06-21 01:10:13 +01:00
Justin Clark-Casey (justincc) 625e5e913a Comment out recently added log message detailing number of scripts started when compile queue empties for now 2012-06-20 00:25:18 +01:00
Justin Clark-Casey (justincc) 881e92a726 Raise some IO associated Exception logging in XEngine to error level, in line with other similar cases.
Remove more unnecessary Close() calls - these are being triggered by the Dispose() called when exiting the using statement for these sdk io objects.
2012-06-20 00:19:50 +01:00
Justin Clark-Casey (justincc) 0fa303b1cf Log how many scripts are candidates for starting and how many are actually started.
Adds DebugLevel infrastructure to XEngine though currently commented out and unused.
2012-06-20 00:10:19 +01:00
Justin Clark-Casey (justincc) ef686ead37 Like the assembly and text files, only write the c#-lsl linemap in XEngine.SetXMLState() if the trust binaries flag is set.
This doesn't affect other locations where the map is written, such as on script compilation.
2012-06-19 02:11:46 +01:00
Justin Clark-Casey (justincc) 8e7032ece8 minor: Add a little more detail to IOException logging in XEngine.SetXMLState()
Also removes superflous Close() commands for statements taking place within using() constructs
Also adds some comment out debug log messages for future use.
2012-06-19 01:53:50 +01:00
Melanie def65cd94a Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
2012-04-25 01:22:09 +01:00
Oren Hurvitz 2f398231ac Minor improvements to logging
Eliminated an extra newline in the console if the log line doesn't contain a category (example of a category: "[ASSETS]").
2012-04-24 21:38:09 +01:00
Melanie beb7b8d189 Fix a logic error in app domain creation 2012-04-18 23:23:37 +01:00
Melanie 525b7593e8 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
2012-04-18 20:09:52 +01:00
Melanie ea73a03553 Don't re-add the assembly resolver for each script if not creating the appdomain 2012-04-18 20:01:41 +01:00
Melanie fe65b51876 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
2012-04-13 03:00:48 +01:00
Talun 08e509978d Mantis 55025 Implement script time.
Signed-off-by: nebadon <michael@osgrid.org>
2012-04-12 18:44:00 -07:00
Melanie 5768a151ff Merge branch 'master' into careminster
Conflicts:
	OpenSim/Data/MySQL/MySQLXAssetData.cs
2012-03-20 02:48:11 +00:00
Justin Clark-Casey (justincc) 437f18bc41 Stop console command "xengine status" throwing an exception if there are no scripts in a region.
Addresses http://opensimulator.org/mantis/view.php?id=5940
2012-03-19 21:43:23 +00:00
Melanie c7e302864a Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
	OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
	OpenSim/Region/Framework/Scenes/Scene.cs
2012-03-18 20:44:56 +00:00
Justin Clark-Casey (justincc) 9497a7c7bd refactor: separate out console and status report generation parts of XEngine 2012-03-16 03:32:14 +00:00
Justin Clark-Casey (justincc) c386b68373 Aggregate script execution times by linksets rather than individual prims.
This is for the top scripts report.
2012-03-16 01:31:53 +00:00
Justin Clark-Casey (justincc) a4b01ef38a Replace script-lines-per-second with the script execution time scaled by its measurement period and an idealised frame time.
The previous lines-per-second measurement used for top scripts report was inaccurate, since lines executed does not reflect time taken to execute.
Also, every fetch of the report would reset all the numbers limiting its usefulness and we weren't even guaranteed to see the top 100.
The actual measurement value should be script execution time per frame but XEngine does not work this way.
Therefore, we use actual script execution time scaled by the measurement period and an idealised frame time.
This is still not ideal but gives reasonable results and allows scripts to be compared.
This commit moves script execution time calculations from SceneGraph into IScriptModule implementations.
2012-03-16 00:34:30 +00:00
Melanie 897dc5e77e Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/Scene.cs
	OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
	OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
2012-03-15 10:55:44 +00:00
Justin Clark-Casey (justincc) 2f81e53f63 Fix a problem where multiple near simultaneous calls to llDie() from multiple scripts in the same linkset can cause unnecessary thread aborts.
The first llDie() could lock Scene.m_deleting_scene_object.
The second llDie() would then wait at this lock.
The first llDie() would go on to remove the second script but always abort it since the second script's WorkItem would not go away.
Easiest solution here is to remove the m_deleting_scene_object since it's no longer justified - we no longer lock m_parts but take a copy instead.
This also requires an adjustment in XEngine.OnRemoveScript not to use instance.ObjectID instead when firing the OnObjectRemoved event.
2012-03-15 00:20:47 +00:00
Justin Clark-Casey (justincc) 12cebb12d5 Alleviate an issue where calling Thread.Abort() on script WorkItems can fail to release locks, resulting in a crippled simulator.
This seems to be a particular problem with ReaderWriterLockSlim, though other locks can be affected as well.
It has been seen to happen when llDie() is called in a linkset running more than one script.
Alleviation here means supplying a ScriptInstance.Stop() timeout of 1000ms rather than 0ms, to give events a chance to complete.
Also, we check the IsRunning status at the top of the ScriptInstance.EventProcessor() so that another event doesn't start in the mean time.
Ultimately, a better solution may have to be found since a long-running event would still exceed the timeout and be aborted.
2012-03-15 00:06:52 +00:00
Melanie c0f70d17fc Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
	OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
2012-03-14 11:33:51 +00:00
Justin Clark-Casey (justincc) 95ec96bf86 refactor: rename ScriptInstance.m_CurrentResult to m_CurrentWorkItem to make it more understandable as to what it is and what it does (hold a thread pool work item for a waiting of in-progress event)
Also add other various illustrative comments
2012-03-14 00:29:36 +00:00
Justin Clark-Casey (justincc) 25592bbd85 Add max thread and min thread information to "xengine status" region console command 2012-03-12 21:16:05 +00:00
Melanie b0fc96c17d Merge branch 'master' into careminster 2012-03-08 19:10:22 +00:00
Justin Clark-Casey (justincc) 749c3fef8a Change "help" to display categories/module list then "help <category/module>" to display commands in a category.
This is to deal with the hundred lines of command splurge when one previously typed "help"
Modelled somewhat on the mysql console
One can still type help <command> to get per command help at any point.
Categories capitalized to avoid conflict with the all-lowercase commands (except for commander system, as of yet).
Does not affect command parsing or any other aspects of the console apart from the help system.
Backwards compatible with existing modules.
2012-03-08 01:51:37 +00:00
Melanie caa19862fa Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/Scene.cs
2012-03-07 00:51:59 +00:00
Justin Clark-Casey (justincc) 98251cdab3 Add sensor, dataserver requests, timer and listener counts to "xengine status" command.
This is for diagnostic purposes.
2012-03-06 23:21:17 +00:00
Melanie 37049180f6 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
	OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
2012-02-07 21:09:04 +00:00
Justin Clark-Casey (justincc) 038d1bf742 Add a regression test to compile and start a script. Remove Path.GetDirectoryName when getting assembly loading path in Compiler.CompileFromDotNetText().
The Path.GetDirectoryName call in Compiler.CompileFromDotNetText is unnecessary since AppDomain.CurrentDomain.BaseDirectory is always a directory.
Later path concatenation is already done by Path.Combine() which handles any trailing slash.
Removing Path.GetDirectoryName() will not affect the runtime but allows NUnit to work since it doesn't add a trailing slash to AppDomain.CurrentDomain.BaseDirectory.
2012-02-07 17:44:37 +00:00