diff options
author | Justin Clark-Casey (justincc) | 2014-12-10 00:25:27 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-12-10 00:25:27 +0000 |
commit | 2b9f0647de513f6a916d9d58d4e7883d30b804d3 (patch) | |
tree | 6a41a0a0c88eb6b6c1ce1d19d64de3837b89c293 /OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |
parent | Avoid a possible race condition where the XEngine script compile thread could... (diff) | |
download | opensim-SC-2b9f0647de513f6a916d9d58d4e7883d30b804d3.zip opensim-SC-2b9f0647de513f6a916d9d58d4e7883d30b804d3.tar.gz opensim-SC-2b9f0647de513f6a916d9d58d4e7883d30b804d3.tar.bz2 opensim-SC-2b9f0647de513f6a916d9d58d4e7883d30b804d3.tar.xz |
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
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine/XEngine.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 51 |
1 files changed, 23 insertions, 28 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index ccd5d99..71ed989 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -716,22 +716,17 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
716 | { | 716 | { |
717 | // Force a final state save | 717 | // Force a final state save |
718 | // | 718 | // |
719 | if (m_Assemblies.ContainsKey(instance.AssetID)) | 719 | try |
720 | { | 720 | { |
721 | string assembly = m_Assemblies[instance.AssetID]; | 721 | instance.SaveState(); |
722 | 722 | } | |
723 | try | 723 | catch (Exception e) |
724 | { | 724 | { |
725 | instance.SaveState(assembly); | 725 | m_log.Error( |
726 | } | 726 | string.Format( |
727 | catch (Exception e) | 727 | "[XEngine]: Failed final state save for script {0}.{1}, item UUID {2}, prim UUID {3} in {4}. Exception ", |
728 | { | 728 | instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID, World.Name) |
729 | m_log.Error( | 729 | , e); |
730 | string.Format( | ||
731 | "[XEngine]: Failed final state save for script {0}.{1}, item UUID {2}, prim UUID {3} in {4}. Exception ", | ||
732 | instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID, World.Name) | ||
733 | , e); | ||
734 | } | ||
735 | } | 730 | } |
736 | 731 | ||
737 | // Clear the event queue and abort the instance thread | 732 | // Clear the event queue and abort the instance thread |
@@ -840,18 +835,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
840 | 835 | ||
841 | foreach (IScriptInstance i in instances) | 836 | foreach (IScriptInstance i in instances) |
842 | { | 837 | { |
843 | string assembly = String.Empty; | ||
844 | |||
845 | lock (m_Scripts) | ||
846 | { | ||
847 | if (!m_Assemblies.ContainsKey(i.AssetID)) | ||
848 | continue; | ||
849 | assembly = m_Assemblies[i.AssetID]; | ||
850 | } | ||
851 | |||
852 | try | 838 | try |
853 | { | 839 | { |
854 | i.SaveState(assembly); | 840 | i.SaveState(); |
855 | } | 841 | } |
856 | catch (Exception e) | 842 | catch (Exception e) |
857 | { | 843 | { |
@@ -1180,7 +1166,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1180 | lock (m_AddingAssemblies) | 1166 | lock (m_AddingAssemblies) |
1181 | { | 1167 | { |
1182 | m_Compiler.PerformScriptCompile(script, assetID.ToString(), item.OwnerID, out assemblyPath, out linemap); | 1168 | m_Compiler.PerformScriptCompile(script, assetID.ToString(), item.OwnerID, out assemblyPath, out linemap); |
1183 | 1169 | ||
1170 | // m_log.DebugFormat( | ||
1171 | // "[XENGINE]: Found assembly path {0} onrez {1} in {2}", | ||
1172 | // assemblyPath, item.ItemID, World.Name); | ||
1173 | |||
1184 | if (!m_AddingAssemblies.ContainsKey(assemblyPath)) { | 1174 | if (!m_AddingAssemblies.ContainsKey(assemblyPath)) { |
1185 | m_AddingAssemblies[assemblyPath] = 1; | 1175 | m_AddingAssemblies[assemblyPath] = 1; |
1186 | } else { | 1176 | } else { |
@@ -1373,7 +1363,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1373 | startParam, postOnRez, | 1363 | startParam, postOnRez, |
1374 | m_MaxScriptQueue); | 1364 | m_MaxScriptQueue); |
1375 | 1365 | ||
1376 | if (!instance.Load(m_AppDomains[appDomain], scriptAssembly, stateSource)) | 1366 | if (!instance.Load( |
1367 | m_AppDomains[appDomain], scriptAssembly, | ||
1368 | Path.Combine(ScriptEnginePath, World.RegionInfo.RegionID.ToString()), stateSource)) | ||
1377 | return false; | 1369 | return false; |
1378 | 1370 | ||
1379 | // if (DebugLevel >= 1) | 1371 | // if (DebugLevel >= 1) |
@@ -1604,7 +1596,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1604 | 1596 | ||
1605 | IScriptInstance instance = (ScriptInstance) parms; | 1597 | IScriptInstance instance = (ScriptInstance) parms; |
1606 | 1598 | ||
1607 | //m_log.DebugFormat("[XEngine]: Processing event for {0}", instance); | 1599 | // m_log.DebugFormat("[XEngine]: Processing event for {0}", instance); |
1608 | 1600 | ||
1609 | return instance.EventProcessor(); | 1601 | return instance.EventProcessor(); |
1610 | } | 1602 | } |
@@ -2200,6 +2192,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
2200 | m_log.ErrorFormat("[XEngine]: Error whilst writing state file {0}, {1}", statepath, ex.Message); | 2192 | m_log.ErrorFormat("[XEngine]: Error whilst writing state file {0}, {1}", statepath, ex.Message); |
2201 | } | 2193 | } |
2202 | 2194 | ||
2195 | // m_log.DebugFormat( | ||
2196 | // "[XEngine]: Wrote state for script item with ID {0} at {1} in {2}", itemID, statepath, m_Scene.Name); | ||
2197 | |||
2203 | return true; | 2198 | return true; |
2204 | } | 2199 | } |
2205 | 2200 | ||