Race condition in Editor Preview Manager and Editor Manager #9485
Labels
bug
bugs found in the application
editor
issues related to the editor
editor-preview
issues that are related to the editor-preview
Bug Description:
If two open requests come in nearly simultaneously, one asking for a preview widget and one asking for a non-preview widget, a race condition in the opening routines of the
EditorPreviewManager
andEditorManager
can lead to an empty editor preview next to an open normal editor and a broken shell / widget tracking system.Steps to Reproduce:
vscode-clangd
plugin#include
directive pointing to an unambiguous filename in your workspace.Ctrl+Click
that filename.Alternatively:
What appears to be happening is that the
EditorPreviewManager
checks for the existence of an editor for the file its trying to open (line 124), and if it doesn't find it, it does some otherasync
work (lines 137ff) before trying to open a new editor (line 139 or 146) for that file. If, between the failed check and the actual opening of a new editor, theEditorManager
has separately handled a request to open the same file, the two openers can come into conflict.theia/packages/editor-preview/src/browser/editor-preview-manager.ts
Lines 113 to 143 in d734315
I've only consistently reproduced the behavior on branches with #9369, but I don't believe that the bug is actually related to that change.
Additional Information
The text was updated successfully, but these errors were encountered: