Bugzilla – Bug 3575
Deadlock in the MainClassUpdater
Last modified: 2012-01-18 15:57:07 UTC
The MainClassUpdater is called from ProjectOpenHook and does parser operation.
For some reason the PathRegistry was not blocked by OpenProjects.get() and RepositoryUpdater right after was blocked by OpenProjects.get(). The OpenProject.get() blocks until all ProjectOpenFooks finish -> deadlock.
I am not able to reproduce it (seems as race in OpenProjects which for a while returns the non blocking Future).
In the NB 7.2 (after merge of the background_scan branch) it will be Ok to call ParserManager.parse() as it's done in MainClassUpdater but calling ParserManager.parseWhenScanFinished() will still cause deadlock in this case. It waits at the end of scan while the scan waits to the end of ProjectOpenHooks. So the code for NB 7.2 can stay as it is, but it's safer to start the MainClassUpdater asynchronously, the patch is attached.
The relevant threads from thread dump are attached deadlock.txt
Created attachment 21 [details]
Created attachment 22 [details]
Fixed in b27a83e3631b74b2ecffe5c1198e2b9da8913b48, thanks tzezula