aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs (unfollow)
Commit message (Collapse)AuthorFilesLines
2013-01-01minor: Assign names to the different SmartThreadPools for debugging purposes.Justin Clark-Casey (justincc)1-0/+1
A different approach to the patch in http://opensimulator.org/mantis/view.php?id=6462 that doesn't involve further forking of SmartThreadPool
2012-12-17Extend default 1 second wait for event completion to other thread script ↵Justin Clark-Casey (justincc)1-1/+1
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-13Add WaitForEventCompletionOnScriptStop [XEngine] config param to ↵Justin Clark-Casey (justincc)1-10/+24
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-12Add "debug script log" command to allow setting a numeric debug level on ↵Justin Clark-Casey (justincc)1-5/+48
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-12Add asset id to "show script" and "show scripts" command output to make it ↵Justin Clark-Casey (justincc)1-0/+1
easier to extract and inspect the script's asset via "dump asset"
2012-12-05Add engine-wide events queued and events processed numbers to output of ↵Justin Clark-Casey (justincc)1-1/+14
"xengine status" console command. For debugging purposes.
2012-12-05Add IScriptInstance.EventsQueued to match EventsProcessed instead of asking ↵Justin Clark-Casey (justincc)1-4/+1
callers to lock and directly inspect the EventQueue
2012-12-05For now, sort "show scripts" output in descending order sorted by events ↵Justin Clark-Casey (justincc)1-3/+21
processed. For debug purposes - should later add options to allow different sorting or show only highest 10, etc.
2012-12-05Add IScriptInstance.EventsProcessed stat so that we can record this ↵Justin Clark-Casey (justincc)1-0/+1
information and display in "show scripts" for debug purposes
2012-12-05In XEngine.DoOnRezScript() use Culture.SetCurrentCulture() instead of ↵Justin Clark-Casey (justincc)1-2/+1
constructing a new CultureInfo separately
2012-12-05On XEngine.ProcessEventHandler(), instead of creating a new CultureInfo on ↵Justin Clark-Casey (justincc)1-2/+1
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-11-15Revert "Merge master into teravuswork", it should have been avination, not ↵teravus1-42/+15
master. This reverts commit dfac269032300872c4d0dc507f4f9062d102b0f4, reversing changes made to 619c39e5144f15aca129d6d999bcc5c34133ee64.
2012-08-25Log initial script startup info notice when xengine actually starts to do ↵Justin Clark-Casey (justincc)1-2/+4
this for debugging purposes, rather than before it actually starts to do this.
2012-08-23If a script state save fails for some reason on shutdown/region removal, get ↵Justin Clark-Casey (justincc)1-2/+25
xengine to spit out some useful information and continue to save other script states
2012-08-18constructor means not having to manually refer to individual propertiesSignpostMarv1-2/+2
2012-08-18refactoring for Vector3 operator & constructor tweaksSignpostMarv1-2/+2
2012-08-17minor: Make xengine debug message on script load a scripting loading message ↵Justin Clark-Casey (justincc)1-7/+9
instead. This is more useful if compilation fails due to an uncatchable exception since we know what was being compiled.
2012-07-25Make SceneManager.OnRegionsReadyStatusChange event available.Justin Clark-Casey (justincc)1-1/+1
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-18Stop the 15 second initial script compile wait if a script is being rezzed ↵Justin Clark-Casey (justincc)1-0/+4
on a previously empty region.
2012-07-17Make the scrpt running flag work properlyMelanie1-0/+16
2012-07-16Revert "Fix script "Running" behavior"Melanie1-7/+0
A better solution using the already present flags must be found. This reverts commit 6d3ee8bb39d47ed7b32e8905fa0b2fc31c5a9f80.
2012-07-11Where possible, use the system Encoding.ASCII and Encoding.UTF8 rather than ↵Justin Clark-Casey (justincc)1-1/+1
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-11Allow XEngine StartDelay to be configured in the [XEngine] config section.Justin Clark-Casey (justincc)1-2/+9
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-11Add regression TestDetachScriptedAttachmentToInventory()Justin Clark-Casey (justincc)1-2/+2
This currently only does a relatively crude check for a ScriptState node in the serialized xml
2012-07-10If a script is being stopped manually, then give the scriptpool thread 1 ↵Justin Clark-Casey (justincc)1-1/+5
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 console region restart: Let Xengine not cry all over the place withUbitUmarov1-6/+10
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-01Add preservation of running state of scripts when drag-copying.Melanie1-0/+12
2012-06-28If rest of first line after colon is blank then still warn about running in ↵Justin Clark-Casey (justincc)1-11/+18
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-28Avoid reporting false positives when a colon is in a comment in the first ↵Justin Clark-Casey (justincc)1-17/+41
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-28minor: reuse colon index calculation in XEngine.OnRezScript. The index if a ↵Justin Clark-Casey (justincc)1-2/+2
colon is found on the first line will always be the same as for the whole script.
2012-06-23Fix script "Running" behaviorBlueWall1-0/+7
Unchecking "Running" box in script editor now persists. This fixes http://opensimulator.org/mantis/view.php?id=6057
2012-06-22Avoid race condition between m_PrimObjects iteration in ↵Justin Clark-Casey (justincc)1-14/+14
XEngine.PostObjectEvent and places where the list is modified by extending the m_PrimObjects lock.
2012-06-22If starting scripts on initial sim start, provide INFO level log feedback ↵Justin Clark-Casey (justincc)1-6/+10
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-22Eliminate unnecessary extra call to TriggerEmptyScriptCompileQueue in ↵Justin Clark-Casey (justincc)1-9/+2
XEngine.DoOnRezScriptQueue() The later invocation of this function will happen on an empty compile queue.
2012-06-20Comment out recently added log message detailing number of scripts started ↵Justin Clark-Casey (justincc)1-2/+2
when compile queue empties for now
2012-06-20Raise some IO associated Exception logging in XEngine to error level, in ↵Justin Clark-Casey (justincc)1-7/+5
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-20Log how many scripts are candidates for starting and how many are actually ↵Justin Clark-Casey (justincc)1-4/+60
started. Adds DebugLevel infrastructure to XEngine though currently commented out and unused.
2012-06-19Like the assembly and text files, only write the c#-lsl linemap in ↵Justin Clark-Casey (justincc)1-27/+27
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-19minor: Add a little more detail to IOException logging in XEngine.SetXMLState()Justin Clark-Casey (justincc)1-11/+14
Also removes superflous Close() commands for statements taking place within using() constructs Also adds some comment out debug log messages for future use.
2012-04-24Minor improvements to loggingOren Hurvitz1-3/+5
Eliminated an extra newline in the console if the log line doesn't contain a category (example of a category: "[ASSETS]").
2012-04-18Fix a logic error in app domain creationMelanie1-1/+1
2012-04-18Don't re-add the assembly resolver for each script if not creating the appdomainMelanie1-4/+8
2012-04-12Mantis 55025 Implement script time.Talun1-34/+48
Signed-off-by: nebadon <michael@osgrid.org>
2012-03-19Stop console command "xengine status" throwing an exception if there are no ↵Justin Clark-Casey (justincc)1-4/+4
scripts in a region. Addresses http://opensimulator.org/mantis/view.php?id=5940
2012-03-16refactor: separate out console and status report generation parts of XEngineJustin Clark-Casey (justincc)1-1/+6
2012-03-16Aggregate script execution times by linksets rather than individual prims.Justin Clark-Casey (justincc)1-3/+2
This is for the top scripts report.
2012-03-16Replace script-lines-per-second with the script execution time scaled by its ↵Justin Clark-Casey (justincc)1-0/+53
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-15Fix a problem where multiple near simultaneous calls to llDie() from ↵Justin Clark-Casey (justincc)1-10/+9
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-15Alleviate an issue where calling Thread.Abort() on script WorkItems can fail ↵Justin Clark-Casey (justincc)1-1/+5
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-14refactor: rename ScriptInstance.m_CurrentResult to m_CurrentWorkItem to make ↵Justin Clark-Casey (justincc)1-1/+0
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