Commit Graph

363 Commits (df7468ffa27b46f074b0f9c6d6c7be4e09164c88)

Author SHA1 Message Date
UbitUmarov 8b1a174430 ****DANGER**** try to make LSL_Types.key to work. bin/ScriptEngines contents must be deleted to recompile scripts. Needs more testing on all uses of key type ****DANGER**** 2016-09-21 14:04:23 +01:00
UbitUmarov 054cc8f08e Xengine only do GC.Collect if logins disabled 2016-09-01 20:49:07 +01:00
UbitUmarov 96ee7e4c2c Xengine: if option AppDomainLoading = true, create script domains for each SOG (like already done for attachments) and not per script. This should reduce number of domains without excessive problem of deleted scripts still loaded. 2016-08-31 12:03:06 +01:00
UbitUmarov 5afc5fe343 Xengine: try to reduce memory pressure of scripts compile. Still ugly code, possible mistakes, but i need to share it before i loose it :) ) 2016-08-31 09:15:08 +01:00
UbitUmarov 4e1784d069 Xengine: remove a no thread safe locking, don't allocate a few objects only needed if creating a new domain 2016-08-30 08:56:35 +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
Melanie Thielker c53f732163 Change the IScriptApi back to it's original form, removing XEngine
specific additions that should not have been there in the first place.
Sleeping and time measurement are now completely internal to XEngine
2015-08-17 21:46:30 +02:00
Oren Hurvitz 59da146e9d When the user stops a script, have it remain stopped
Previously the script state was never saved for a !Running script, so upon region restart the script would be Running again.

The use of the 'StayStopped' flag is needed because all scripts are automatically stopped when the region shuts down, but in that case we shouldn't save in their state that they're !Running.
2015-08-11 08:44:27 +01:00
Oren Hurvitz a3bed1fbcb Report "Script Execution Time" as the time spent executing the script in the last 30 seconds. Use a sliding window to calculate this.
Notes:
- This metric provides a better indication of which scripts are taking up a lot of CPU (and therefore should be optimized).
- Previously the execution time was reset to 0 in every new measurement period, causing the reported time to fluctuate for no reason. This has been fixed by using a sliding window.
2015-08-11 08:42:26 +01:00
Oren Hurvitz 287096d826 Improved calculation of Script Execution TimeStarted
1. Use a Stopwatch (a high-resolution timer)
2. Whenever we start a new measurement period, zero out the total execution time (previously it just kept accumulating)
3. Changed the measurement period from 30 minutes to 30 seconds. This is much more useful in the "Top Scripts" dialog, as it shows currently active scripts
2015-08-11 07:35:41 +01:00
Oren Hurvitz 7457173fe4 Fixed calling "debug xengine log" without the 'level' parameter: this should show the current log level; not crash 2015-08-11 07:35:38 +01:00
Glenn Martin 1959eb8372 Moved over metrics from previous OpenSim 0.8.0.3 repository (this new repository is now the master branch from OpenSim). 2015-04-21 14:29:17 -04:00
Justin Clark-Casey (justincc) 557b0fae85 minor: correct log message when script with non-config stop strategy is detected to log actual strategy rather than true/false 2015-01-29 18:28:17 +00:00
Justin Clark-Casey (justincc) cf0087e87c Correct typo in raw default script stop strategy 2015-01-27 21:04:11 +00:00
Justin Clark-Casey (justincc) e0a3440263 If [XEngine] ScriptStopStrategy is different from a compiled script strategy, ask user to manually set DeleteScriptsOnStartup = true for at least one simuator session rather than auto-recompiling.
This does not work on Windows since the VM retains a handle to the DLL even if class instantiation was unsuccessful.
Which causes deletion of the old DLL to fail with access sharing violations.
Instead, log a warning in this situation asking the user to manually set DeleteScriptsOnStartup = true for a session (or one could separately delete the DLLs in the relevant bin/scriptengines/<region-uuid> dir
For the current session, the script engine will continue using the script compiled stop strategy as before.
Relates to http://opensimulator.org/mantis/view.php?id=7278
2015-01-27 19:07:20 +00:00
Justin Clark-Casey (justincc) 13ba2f2d83 If an exception comes out of DoOnRezScript in DoOnRezScriptQueue(), then only fail a single script rather than halting the exntire script startup process. 2015-01-26 23:32:51 +00:00
Justin Clark-Casey (justincc) 1bed3aff0b On a multi-region simulator when AppDomain = true, make sure the DLL from the appropriate script engines subdir is loaded rather than always that of the first engine to load the DLL.
This resolves a DLL load failure on my Linux box when an attachment script was present on another region before the avatar arrived.
2015-01-26 23:31:46 +00:00
Justin Clark-Casey (justincc) 2995868176 Make XEngine.SaveAllState() actually do this instead of script maintenance 2015-01-17 00:05:13 +00:00
Justin Clark-Casey (justincc) 0eb268e265 minor: remove old commented out objectRemoved bool in XEngine.OnRemoveScript() 2015-01-16 23:59:08 +00:00
Justin Clark-Casey (justincc) 58f7efc41a Add clearqueue code adjustment that should have been in previous commit faaf47a 2015-01-16 23:57:51 +00:00
Justin Clark-Casey (justincc) faaf47a86f Prevent a race condition between the script engine backup thread and script removal by locking on the script's EventQueue and only proceeding if it's flagged as still running.
Relates to http://opensimulator.org/mantis/view.php?id=7407
2015-01-16 23:55:11 +00:00
Justin Clark-Casey (justincc) 8d724e90de For scripts in attachments, don't save .state files apart from the initial one as these are ignored since .state is saved in the attachment's asset.
This eliminates pointless work and exceptions when an appdomain is unloaded whilst an attachment script state is persisted.
Adds test for this case.
Relates to http://opensimulator.org/mantis/view.php?id=7407
2015-01-16 22:46:48 +00:00
Diva Canto 7466ef0525 This cleans up versioning. Specifically:
- It establishes 4 digits for opensim versions
- It uses the same number between opensim releases and mono addins versions

It also eliminates the last addin.xml files that were still there, for consistency.
2014-12-30 12:53:31 -08:00
Justin Clark-Casey (justincc) 147d401b28 Remove XEngine.m_uniqueScripts
This provides no obvious benefit as far as I can tell but has a definite cost in keep script strings in memory for the entire simulator session.
2014-12-15 20:38:26 +00:00
Justin Clark-Casey (justincc) 2b9f0647de Fix a regression where objects crossing regions in the same simulator (on their own or as attachments) with AppDomainLoading = false would create the new state in the source region area rather than the dest.
This was beause the code was finding the script DLL compiled for the source region as everything is in the same appdomain and using this as the location for the destination script state, etc.
This resolves the regression by passing the proper destination separately from the DLL retrieved.
Probably a regression since commit d7b92604 (11 July 2014).
Added regression test for this case.
At least partly addresses http://opensimulator.org/mantis/view.php?id=7278
2014-12-10 00:25:27 +00:00
Justin Clark-Casey (justincc) 227d2e2b61 Avoid a possible race condition where the XEngine script compile thread could complete but see OnRezScript() insert a new job and complete before it set m_CurrentCompile = null
If the above happened, it would mean the new script would not compile until some  script was added for compilation.
2014-12-10 00:04:10 +00:00
Justin Clark-Casey (justincc) 76722d8324 In XEngine, enqueue a script rez to the compile queue after setting m_CompileDict to avoid a rare but not impossible race condition. 2014-12-09 23:59:19 +00:00
Justin Clark-Casey (justincc) d34ad345d5 minor: If we are recompiling scripts in response to a ScriptStopStrategy config change (a rare situation), then explicitly log this for debug purposes. 2014-12-03 21:08:43 +00:00
Justin Clark-Casey (justincc) c3c05a8693 Reintroduce general xengine extra debugging log level. This can be controlled at runtime with the command "debug xengine log <level>", as with similar commands.
If log level is 1 then every script load is logged.
This means the <logger name="OpenSim.Region.ScriptEngine.XEngine"> section in OpenSim.exe.config is no longer needed to avoid log spam on regions with many scripts and can be removed.
2014-12-03 20:48:17 +00:00
Justin Clark-Casey (justincc) 805b7ccb3e minor: improve logged error in XEngine.SetXmlState if there was a problem writing the linemap.
The previous error report of already exists is inaccurate since existing files do get overwritten.
2014-12-03 20:35:49 +00:00
Justin Clark-Casey (justincc) 432f0e8783 Correct 690fe0c to actually log the exception reported in DoOnRezScriptQueue()(and now the scene name). 2014-11-29 15:04:16 +00:00
Justin Clark-Casey (justincc) 690fe0c5e5 If there are any exceptions in XEngine.DoOnRezScriptQueue() then log the error and always set m_CurrentCompile = null
Setting m_CurrentCompile = null in the finally block reduces the risk that an exception could permanently stop any future scripts compiling until the simulator is restarted.
If an exception is seen from this then please report and further changes to fix the bug or improve compiling reliability can be made.
2014-11-29 01:42:52 +00:00
Justin Clark-Casey (justincc) 55e064baf7 Remove minor race condition where two threads could race on fields such as m_ScriptFailCount as set in XEngine.DoOnRezScriptQueue() 2014-11-29 01:33:14 +00:00
UbitUmarov 382df37f80 remove some Xengine errors on scripted object delete 2014-10-22 10:21:54 +01:00
Melanie Thielker e1b2ecdfdc Merge branch 'avination-current'
Conflicts:
	OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
2014-07-19 22:32:07 +02:00
UbitUmarov d5e0437465 fix Xengine script instance load 2014-07-18 11:43:31 +01:00
Justin Clark-Casey (justincc) 8cd7ca568d Change default script stop method to co-op instead of abort.
co-op should be more stable as it doesn't abort threads, which can trigger virtual machine instability
This change will be invisible to users as script DLLs are recompiled automatically where necessary, though the change won't take affect until the next simulator restart.
This change has no effect on existing script state.
If you want to continue using abort, set ScriptStopStrategy = abort in the [XEngine] section of OpenSim.ini
2014-07-16 22:58:38 +01:00
Justin Clark-Casey (justincc) 2766bf3fef minor: Move debug xengine script console command to Debug help section where other debug commands live. 2014-07-11 00:18:39 +01:00
Justin Clark-Casey (justincc) 15b38f0036 minor: further cleanup of old vb and yield prolog script engine references that were removed some time ago 2014-07-11 00:15:47 +01:00
Justin Clark-Casey (justincc) d7b9260496 If [XEngine] ScriptStopStrategy is changed between abort and co-op, for the existing session use the previous strategy for that script rather than not starting the script at all.
We have to do this since we can't unload existing DLLs if they're all in the same AppDomain.
But we can still update the underlying DLL which will be used in the next simulator session.
2014-07-11 00:03:02 +01: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
Eva Comaroski 63ccc3dbf5 Convert if-blocks to return statements in small functions such as GetStartParameter(). 2013-12-14 01:20:24 +00:00
Melanie 72206a0e29 Merge branch 'avination-current' into careminster
Conflicts:
	OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
	OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
2013-09-16 22:32:53 +01:00
teravus 01c3be2746 * Fix a null ref that causes a stack unwind when crossing borders. Less stack unwinding.. the faster it goes.
* Tweak XEngine so that it's partially functional again.    It's still not great, but basic things work.
2013-08-24 05:55:53 -05:00
Melanie 8c5445b774 Merge branch 'master' into careminster
Conflicts:
	ThirdParty/SmartThreadPool/SmartThreadPool.cs
2013-05-01 21:39:49 +01:00
Justin Clark-Casey (justincc) 206fb306a7 Update SmartThreadPool to latest version 2.2.3 with a major and minor change.
SmartThreadPool code comes from http://www.codeproject.com/Articles/7933/Smart-Thread-Pool
This version implements thread abort (via WorkItem.Cancel(true)), threadpool naming, max thread stack, etc. so we no longer need to manually patch those.
However, two changes have been made to stock 2.2.3.
Major change: WorkItem.Cancel(bool abortExecution) in our version does not succeed if the work item was in progress and thread abort was not specified.
This is to match previous behaviour where we handle co-operative termination via another mechanism rather than checking WorkItem.IsCanceled.
Minor change: Did not add STP's StopWatch implementation as this is only used WinCE and Silverlight and causes a build clash with System.Diagnostics.StopWatch
The reason for updating is to see if this improves http://opensimulator.org/mantis/view.php?id=6557 and http://opensimulator.org/mantis/view.php?id=6586
2013-05-01 19:01:43 +01:00
Melanie 41a652f6bd Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
2013-04-02 23:47:19 +01:00
Justin Clark-Casey (justincc) 2bfe60e2fb Use Output instead of OutputFormat in appropriate places of XEngine status reporting. 2013-04-02 01:28:16 +01:00
Melanie 9a4de546fe Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
2013-01-31 02:53:11 +00:00