[Solved] A* hangs on reloading scene

Hi, we are having some issues when restarting a scene with A* pathfinding project

We have a scene with a AStarGrid and some obstacles, when we restart the scene (by script), some of the time it works properly, but sometimes it hangs unity, and by attaching the debugger and pausing all threads we can see that the engine got blocked in some code from A*.

We are not doing anything at the moment of restarting, just loading again the same scene.
We tried updating to the last version without improvements.
We are attaching the info we are getting about the hangs.

Case 1 (using old version)
Pathfinding.GraphUpdateProcessor.ProcessGraphUpdatesAsync() = line 292

Case 2 (using old version)
Pathfinding.PathProcessor.PathProcessor.AnonymousMethod__14()
Pathfinding.PathProcessor.CalculatePathsThreaded (treadInfo={Pathfinding.PathThreadInfo})
Pathfinding.ThreadControlQueue.Pop() = line 185

Case 3 (using latest version)
AstarPath.ProcessGraphUpdatesAsync (_astar={AstarPath}) = line 1340

Thanks for any information!

Hi

That looks serious. Thank you for reporting this.
Do you happen to have excerpts from the lines of code that it hangs on? My development version does not use the same line numbers as the released version and it is hard to know exactly which version you are using (latest version sure, but is it the free or pro version?). Also, would it be ok with you to share your project with me so I could debug it more easily (alternatively make a small self contained example scene which has the bug)?

Hi, thank you for your answer.
We are using the last pro version.

I’m adding a link to images with more info of the hangs: http://imgur.com/a/weRSg

We will make a light project to share.
Thank you for your support.
PS: Is there some method that must be called before reload the scene?

Hi

Ok, it seems it is hanging because of some async graph update that is not being performed, I am not sure why it is not however…
A temporary fix could be to turn off multithreading (A* Inspector -> Settings -> Threads = None).

It should not be necessary to call some specific method before reloading the scene, everything should be cleaned up automatically (even though it obviously is not in this case).

Actually no. I looked at the screenshots again. What you have found there are the worker threads that the A* Pathfinding Project uses for graph updates and for pathfinding, it is not the main Unity thread.

Hi, we tested your suggestion of disabling threading and were able to found the problem.
There is no issue with your plugin, the problem was in the plugin “Console Pro 3”, it was hanging the main thread, but when pausing with monodevelop it decided to show the A* threads instead of the main thread (when we disabled threading the Console Pro 3 was the only one and we were able to find it).

Thanks for your help and sorry for misreporting the issue.

1 Like

Ah, I see.
Ok. I’m glad the issue has been resolved.