You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While debugging something, the LS got stuck in a deadlock. This has never happened to me during normal use and probably requires very specific timing/delay in threads so it may not happen in normal use, but here is what can happen:
One thread computes something on the main thread that got put there through the AbstractLanguageServer.addToMainThreadQueue method, i.e. the layoutEngine.layout(newRoot, cause) call in KGraphDiagramServer.doSubmitModel. It therefore holds the lock for the main thread queue (which is a blocking queue) and waits for the diagramState (which will be locked by the KGraphLayoutEngine call.
Another thread is in the KGraphDiagramUpdater.doUpdateDiagram method, calling the prepareModel method after locking the diagramState lock. This method then calls the AbstractLanguageServer.addToMainThreadQueue method, trying to access the main thread queue lock, thus resulting in a circular dependency and a deadlock.
A first idea: We probably should never hold the diagramState lock when trying to access the main thread queue lock, thus fixing any calls to that and documenting this restriction.
The text was updated successfully, but these errors were encountered:
While debugging something, the LS got stuck in a deadlock. This has never happened to me during normal use and probably requires very specific timing/delay in threads so it may not happen in normal use, but here is what can happen:
One thread computes something on the main thread that got put there through the
AbstractLanguageServer.addToMainThreadQueue
method, i.e. thelayoutEngine.layout(newRoot, cause)
call inKGraphDiagramServer.doSubmitModel
. It therefore holds the lock for the main thread queue (which is a blocking queue) and waits for thediagramState
(which will be locked by theKGraphLayoutEngine
call.Another thread is in the
KGraphDiagramUpdater.doUpdateDiagram
method, calling theprepareModel
method after locking thediagramState
lock. This method then calls theAbstractLanguageServer.addToMainThreadQueue
method, trying to access the main thread queue lock, thus resulting in a circular dependency and a deadlock.A first idea: We probably should never hold the
diagramState
lock when trying to access the main thread queue lock, thus fixing any calls to that and documenting this restriction.The text was updated successfully, but these errors were encountered: