View Issue Details

IDProjectCategoryLast Update
0025822AI War 2Crash/ExceptionNov 15, 2021 5:48 pm
ReporterDaniexpert Assigned Tox4000Bughunter  
Severityminor 
Status resolvedResolutionfixed 
Product VersionBeta 3.751 Faction Processing Groups 
Fixed in VersionBeta 3.751 Faction Processing Groups 
Summary0025822: Neinzul SappersSappersLRP pathfinder threading exception
DescriptionSee log.
TagsNo tags attached.

Relationships

related to 0025801 resolvedx4000Bughunter Called ElderlingsElderlingsLRP pathfinder again before it finished finding the first path! 

Activities

Daniexpert

Nov 14, 2021 11:08 am

developer  

pathfinder.txt (4,519 bytes)   
11/14/2021 5:05:09 PM	3.750	SINGLEP	DELAYED8 TID6 Called Neinzul SappersSappersLRP pathfinder again before it finished finding the first path!  This probably means it's being called by two threads! Run started: 0 ticks ago (0ms)
  at System.Environment.get_StackTrace () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at Arcen.Universal.ArcenDebugging.ArcenDebugLog (System.String Message, Arcen.Universal.Verbosity Verbosity) [0x00000] in <5f6d124dd87c498290e79b2f5be480a9>:0 
  at Arcen.AIW2.External.ArcenPathfinder`1[N].FindPathInner (Arcen.AIW2.Core.Faction Fac, System.String DebugAddendum, Arcen.Universal.List`1[T] PathToFill, N Origin, N Target, System.Int32 NeedToGetWithinXRangeOfTarget, System.Int32 RequiresNoMoreThanXRangeFromOrigin, System.Boolean DoDebugLog, Arcen.AIW2.Core.ArcenSimContextAnyStatus Context) [0x00000] in <0acfae709fe5460b8a37c029c6497ae2>:0 
  at Arcen.AIW2.External.ArcenPathfinder`1[N].FindPath (Arcen.AIW2.Core.Faction Fac, System.String DebugAddendum, Arcen.Universal.List`1[T] PathToFill, N Origin, N Target, System.Int32 NeedToGetWithinXRangeOfTarget, System.Int32 RequiresNoMoreThanXRangeFromOrigin, System.Boolean DoDebugLog, Arcen.AIW2.Core.ArcenSimContextAnyStatus Context) [0x00000] in <0acfae709fe5460b8a37c029c6497ae2>:0 
  at Arcen.AIW2.External.PathingHelper.InnerFindPath_Raw (Arcen.AIW2.Core.Faction faction, System.String DebugAddendum, Arcen.AIW2.Core.Planet Origin, Arcen.AIW2.Core.Planet Target, Arcen.AIW2.External.PathingMode mode, Arcen.AIW2.Core.ArcenSimContextAnyStatus Context) [0x00000] in <0acfae709fe5460b8a37c029c6497ae2>:0 
  at Arcen.AIW2.External.PathingHelper.FindPathFreshOrFromCache (Arcen.AIW2.Core.Faction ForFaction, System.String DebugAddendum, Arcen.AIW2.Core.Planet Origin, Arcen.AIW2.Core.Planet Target, Arcen.AIW2.External.PathingMode mode, Arcen.AIW2.Core.ArcenSimContextAnyStatus Context) [0x00000] in <0acfae709fe5460b8a37c029c6497ae2>:0 
  at Arcen.AIW2.External.ElderlingsFactionDeepInfo.DoLongRangePlanning_OnBackgroundNonSimThread_Subclass (Arcen.AIW2.External.ArcenLongTermIntermittentPlanningContext Context) [0x00000] in <f54e41c326a340f5b7f104d946d0846f>:0 
  at Arcen.AIW2.External.ExternalFactionDeepInfoRoot.DoLongRangePlanning_OnBackgroundNonSimThread_HostOnly (Arcen.AIW2.Core.ILongRangePlanningHostContext Context) [0x00000] in <f54e41c326a340f5b7f104d946d0846f>:0 
  at Arcen.AIW2.Core.Faction.Safe_DeepInfo_DoLongRangePlanning_OnBackgroundNonSimThread_HostOnly (Arcen.AIW2.Core.ILongRangePlanningHostContext Context) [0x00000] in <dce639986ca44b9687a07263432ca408>:0 
  at Arcen.AIW2.External.SpecialFactionPlanning.Execute () [0x00000] in <f54e41c326a340f5b7f104d946d0846f>:0 
  at Arcen.AIW2.External.ArcenHostOnlySimPlanningContext.BackgroundThreadRunHandler (System.Boolean FailSilentlyIfNotFinishedYet) [0x00000] in <0acfae709fe5460b8a37c029c6497ae2>:0 
  at Arcen.AIW2.External.ArcenHostOnlySimPlanningContext+<>c__DisplayClass13_0.<RunOnBackgroundThread>b__0 () [0x00000] in <0acfae709fe5460b8a37c029c6497ae2>:0 
  at System.Threading.Tasks.Task.InnerInvoke () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Threading.Tasks.Task.Execute () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Threading.Tasks.Task.ExecutionContextCallback (System.Object obj) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Threading.Tasks.Task.ExecuteWithThreadLocal (System.Threading.Tasks.Task& currentTaskSlot) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Threading.Tasks.Task.ExecuteEntry (System.Boolean bPreventDoubleExecution) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
pathfinder.txt (4,519 bytes)   

Daniexpert

Nov 14, 2021 11:38 am

developer   ~0063295

Same with ElderlingsElderlingsLRP
pathfinderElder.txt (4,518 bytes)   
11/14/2021 5:37:01 PM 3.750 SINGLEP DELAYED9 TID19 Called ElderlingsElderlingsLRP pathfinder again before it finished finding the first path!  This probably means it's being called by two threads! Run started: 0 ticks ago (0ms)
  at System.Environment.get_StackTrace () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at Arcen.Universal.ArcenDebugging.ArcenDebugLog (System.String Message, Arcen.Universal.Verbosity Verbosity) [0x00000] in <5f6d124dd87c498290e79b2f5be480a9>:0 
  at Arcen.AIW2.External.ArcenPathfinder`1[N].FindPathInner (Arcen.AIW2.Core.Faction Fac, System.String DebugAddendum, Arcen.Universal.List`1[T] PathToFill, N Origin, N Target, System.Int32 NeedToGetWithinXRangeOfTarget, System.Int32 RequiresNoMoreThanXRangeFromOrigin, System.Boolean DoDebugLog, Arcen.AIW2.Core.ArcenSimContextAnyStatus Context) [0x00000] in <0acfae709fe5460b8a37c029c6497ae2>:0 
  at Arcen.AIW2.External.ArcenPathfinder`1[N].FindPath (Arcen.AIW2.Core.Faction Fac, System.String DebugAddendum, Arcen.Universal.List`1[T] PathToFill, N Origin, N Target, System.Int32 NeedToGetWithinXRangeOfTarget, System.Int32 RequiresNoMoreThanXRangeFromOrigin, System.Boolean DoDebugLog, Arcen.AIW2.Core.ArcenSimContextAnyStatus Context) [0x00000] in <0acfae709fe5460b8a37c029c6497ae2>:0 
  at Arcen.AIW2.External.PathingHelper.InnerFindPath_Raw (Arcen.AIW2.Core.Faction faction, System.String DebugAddendum, Arcen.AIW2.Core.Planet Origin, Arcen.AIW2.Core.Planet Target, Arcen.AIW2.External.PathingMode mode, Arcen.AIW2.Core.ArcenSimContextAnyStatus Context) [0x00000] in <0acfae709fe5460b8a37c029c6497ae2>:0 
  at Arcen.AIW2.External.PathingHelper.FindPathFreshOrFromCache (Arcen.AIW2.Core.Faction ForFaction, System.String DebugAddendum, Arcen.AIW2.Core.Planet Origin, Arcen.AIW2.Core.Planet Target, Arcen.AIW2.External.PathingMode mode, Arcen.AIW2.Core.ArcenSimContextAnyStatus Context) [0x00000] in <0acfae709fe5460b8a37c029c6497ae2>:0 
  at Arcen.AIW2.External.ElderlingsFactionDeepInfo.DoLongRangePlanning_OnBackgroundNonSimThread_Subclass (Arcen.AIW2.External.ArcenLongTermIntermittentPlanningContext Context) [0x00000] in <f54e41c326a340f5b7f104d946d0846f>:0 
  at Arcen.AIW2.External.ExternalFactionDeepInfoRoot.DoLongRangePlanning_OnBackgroundNonSimThread_HostOnly (Arcen.AIW2.Core.ILongRangePlanningHostContext Context) [0x00000] in <f54e41c326a340f5b7f104d946d0846f>:0 
  at Arcen.AIW2.Core.Faction.Safe_DeepInfo_DoLongRangePlanning_OnBackgroundNonSimThread_HostOnly (Arcen.AIW2.Core.ILongRangePlanningHostContext Context) [0x00000] in <dce639986ca44b9687a07263432ca408>:0 
  at Arcen.AIW2.External.SpecialFactionPlanning.Execute () [0x00000] in <f54e41c326a340f5b7f104d946d0846f>:0 
  at Arcen.AIW2.External.ArcenHostOnlySimPlanningContext.BackgroundThreadRunHandler (System.Boolean FailSilentlyIfNotFinishedYet) [0x00000] in <0acfae709fe5460b8a37c029c6497ae2>:0 
  at Arcen.AIW2.External.ArcenHostOnlySimPlanningContext+<>c__DisplayClass13_0.<RunOnBackgroundThread>b__0 () [0x00000] in <0acfae709fe5460b8a37c029c6497ae2>:0 
  at System.Threading.Tasks.Task.InnerInvoke () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Threading.Tasks.Task.Execute () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Threading.Tasks.Task.ExecutionContextCallback (System.Object obj) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Threading.Tasks.Task.ExecuteWithThreadLocal (System.Threading.Tasks.Task& currentTaskSlot) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Threading.Tasks.Task.ExecuteEntry (System.Boolean bPreventDoubleExecution) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
pathfinderElder.txt (4,518 bytes)   

Daniexpert

Nov 14, 2021 11:47 am

developer   ~0063296

Same with Neinzul SappersSappersSendShipToPlanet

x4000Bughunter

Nov 15, 2021 5:48 pm

administrator   ~0063308

Thanks!

* Improved the pathfinding error handling debug info.

* Added a new processing_group="Name" on faction definitions that is required.
** This allows us to aggregate "hey, am I allowed to run at the same time?" in the way we really need to. We had something like this before, but not enough.
** This in turn requires new xml in a new folder called SpecialFactionProcessingGroup, and that fills a SpecialFactionProcessingGroup object in the code, which is mostly used for LRP threading locks.

* UniqueNameForFactionToAvoidThreadConflicts has been removed, replaced with a reference to the faction's SpecialFactionProcessingGroup.

* Okay! This has been a problem for longer than I realized, as it turns out; it just has been more obvious in recent months.
** Essentially, the way we were handling factions that used shared resources for their "LRP processing" previously only attempted to not let them START in the same lrp sim cycle, but it was not preventing them from starting in multiple cycles and thus overlapping.
** Good grief, this was more untangling than expected. This SHOULD prove to be the end of any sort of "pathfinder already running" errors, but we'll have to wait longer and see if folks still run into it. I really don't think they will, knock on wood.

Issue History

Date Modified Username Field Change
Nov 14, 2021 11:08 am Daniexpert New Issue
Nov 14, 2021 11:08 am Daniexpert File Added: pathfinder.txt
Nov 14, 2021 11:38 am Daniexpert Note Added: 0063295
Nov 14, 2021 11:38 am Daniexpert File Added: pathfinderElder.txt
Nov 14, 2021 11:47 am Daniexpert Note Added: 0063296
Nov 14, 2021 3:57 pm BadgerBadger Relationship added related to 0025801
Nov 15, 2021 5:48 pm x4000Bughunter Assigned To => x4000Bughunter
Nov 15, 2021 5:48 pm x4000Bughunter Status new => resolved
Nov 15, 2021 5:48 pm x4000Bughunter Resolution open => fixed
Nov 15, 2021 5:48 pm x4000Bughunter Fixed in Version => Beta 3.751 Faction Processing Groups
Nov 15, 2021 5:48 pm x4000Bughunter Note Added: 0063308