StrangeLoopGames / EcoIssues

131 stars 21 forks source link

[0.9.0 staging-1531] Strange disconnects #16052

Closed SlayksWood closed 4 years ago

SlayksWood commented 4 years ago

Can't reproduce by 100%, but today I have it 3 times: 1st - I created laws, 2nd and 3rd I checked work party/contracts. When disconnect start in log exceptions spam:

Exception: Expected to receive type key, since there is no view mapping for ID 4475, but type key was not given
  at Eco.Shared.View.ViewManager.GetView (Eco.Shared.Serialization.BSONObject bson) [0x00000] in <00000000000000000000000000000000>:0 
  at Eco.Shared.View.ViewManager.UnpackageView (Eco.Shared.Serialization.BSONObject bson) [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.Properties.TypeConversion+Converter`2+ConvertDelegate[TSource,TDestination].Invoke (TSource value) [0x00000] in <00000000000000000000000000000000>:0 
  at Eco.Shared.Serialization.BsonManipulator.FromBson (Eco.Shared.Serialization.BSONValue value, System.Type type) [0x00000] in <00000000000000000000000000000000>:0 
  at Eco.Shared.Utils.ListExtensions.FromBson[T] (System.Collections.Generic.IList`1[T] list, Eco.Shared.Serialization.BSONArray bsonArray) [0x00000] in <00000000000000000000000000000000>:0 
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <00000000000000000000000000000000>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0 
  at Eco.Shared.Serialization.BsonManipulator.FromBsonIList (System.Type type, Eco.Shared.Serialization.BSONValue value) [0x00000] in <00000000000000000000000000000000>:0 
  at Eco.Shared.Serialization.BsonManipulator.FromBsonIDictionary (System.Type type, Eco.Shared.Serialization.BSONObject obj) [0x00000] in <00000000000000000000000000000000>:0 
  at Eco.Shared.Serialization.BsonManipulator.FromBson (Eco.Shared.Serialization.BSONValue value, System.Type type) [0x00000] in <00000000000000000000000000000000>:0 
  at Eco.Shared.View.View.UpdateProperty (Eco.Shared.Serialization.BSONValue propNameID, Eco.Shared.Serialization.BSONObject bson) [0x00000] in <00000000000000000000000000000000>:0 
  at Eco.Shared.View.ViewManager.ViewNotify (Eco.Shared.Serialization.BSONObject bson, Eco.Shared.View.View view, System.Collections.Generic.List`1[T] notifications) [0x00000] in <00000000000000000000000000000000>:0 
  at Eco.Shared.View.ViewManager.ApplyProperties (Eco.Shared.View.View view, Eco.Shared.Serialization.BSONObject bson, System.Collections.Generic.List`1[T] notifications) [0x00000] in <00000000000000000000000000000000>:0 
  at Eco.Shared.View.ViewManager.ReceiveViewUpdate (Eco.Shared.Serialization.BSONArray updates) [0x00000] in <00000000000000000000000000000000>:0 
  at ClientPacketHandler.ReceiveWhile (Eco.Shared.Networking.NetworkClient client, System.Func`1[TResult] condition) [0x00000] in <00000000000000000000000000000000>:0 
  at System.Action`1[T].Invoke (T obj) [0x00000] in <00000000000000000000000000000000>:0 
  at FramePlanner.PlannerGroup.OnUpdate () [0x00000] in <00000000000000000000000000000000>:0 
  at FramePlanner.FramePlannerSystem.OnUpdate () [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.Entities.ComponentSystem.InternalUpdate () [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.Entities.ComponentSystemGroup.OnUpdate () [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.Entities.ComponentSystem.InternalUpdate () [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.Experimental.LowLevel.PlayerLoopSystem+UpdateFunction.Invoke () [0x00000] in <00000000000000000000000000000000>:0 
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <00000000000000000000000000000000>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0 
  at Eco.Shared.Serialization.BsonManipulator.FromBsonIList (System.Type type, Eco.Shared.Serialization.BSONValue value) [0x00000] in <00000000000000000000000000000000>:0 
  at Eco.Shared.Serialization.BsonManipulator.FromBsonIDictionary (System.Type type, Eco.Shared.Serialization.BSONObject obj) [0x00000] in <00000000000000000000000000000000>:0 
  at Eco.Shared.Serialization.BsonManipulator.FromBson (Eco.Shared.Serialization.BSONValue value, System.Type type) [0x00000] in <00000000000000000000000000000000>:0 
  at Eco.Shared.View.View.UpdateProperty (Eco.Shared.Serialization.BSONValue propNameID, Eco.Shared.Serialization.BSONObject bson) [0x00000] in <00000000000000000000000000000000>:0 
  at Eco.Shared.View.ViewManager.ViewNotify (Eco.Shared.Serialization.BSONObject bson, Eco.Shared.View.View view, System.Collections.Generic.List`1[T] notifications) [0x00000] in <00000000000000000000000000000000>:0 
  at Eco.Shared.View.ViewManager.ApplyProperties (Eco.Shared.View.View view, Eco.Shared.Serialization.BSONObject bson, System.Collections.Generic.List`1[T] notifications) [0x00000] in <00000000000000000000000000000000>:0 
  at Eco.Shared.View.ViewManager.ReceiveViewUpdate (Eco.Shared.Serialization.BSONArray updates) [0x00000] in <00000000000000000000000000000000>:0 
  at ClientPacketHandler.ReceiveWhile (Eco.Shared.Networking.NetworkClient client, System.Func`1[TResult] condition) [0x00000] in <00000000000000000000000000000000>:0 
  at System.Action`1[T].Invoke (T obj) [0x00000] in <00000000000000000000000000000000>:0 
  at FramePlanner.PlannerGroup.OnUpdate () [0x00000] in <00000000000000000000000000000000>:0 
  at FramePlanner.FramePlannerSystem.OnUpdate () [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.Entities.ComponentSystem.InternalUpdate () [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.Entities.ComponentSystemGroup.OnUpdate () [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.Entities.ComponentSystem.InternalUpdate () [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.Experimental.LowLevel.PlayerLoopSystem+UpdateFunction.Invoke () [0x00000] in <00000000000000000000000000000000>:0 
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
FramePlanner.PlannerGroup:OnUpdate()
FramePlanner.FramePlannerSystem:OnUpdate()
Unity.Entities.ComponentSystem:InternalUpdate()
Unity.Entities.ComponentSystemGroup:OnUpdate()
Unity.Entities.ComponentSystem:InternalUpdate()
UnityEngine.Experimental.LowLevel.UpdateFunction:Invoke()

https://drive.google.com/file/d/1NYKGOIEf2XpbGXydUDLAT3hN550Se_ot/view?usp=sharing then I can't connect to server, i need to restart game

mirasrael commented 4 years ago

@johnkslg may be related to your view system changes

mirasrael commented 4 years ago

Or probably it is related to deadlock fix. I'll investigate this.

mirasrael commented 4 years ago

I fixed this and I think it start happening as combination of two factors:

I refactored code to totally prevent this situation even in very lucky scenario before and still avoid dead lock.