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
When using an interpreter from the generator, the interpreter lookup mechanism uses underlying MPS/IDEA indices and sometimes blocks until the indices can be updated in a separate thread in a read action. If a write action becomes pending in the meantime, the indexing thread cannot acquire the read lock, while the write action cannot proceed until the generator finishes, leading to a deadlock.
Proposed solution:
Change the interpreter lookup mechanism to use the existing InterpreterExtensionPoint (MPS link) and never refer to the interpreter source nodes at run time.
To maintain backwards compatibility, proceed in stages. First, add getCategory() method to IInterpreter and generate it for all interpreters. We can add the method in a backwards compatible fashion by providing a default implementation but existing interpreters will have to be regenerated to return a proper value from this method.
Until we can be reasonably sure that all interpreters implement getCategory(), we cannot use it for lookups, so as an interim solution, continue looking up interpreters the old way but disable indexing while doing so.
After some time has passed, change the look up mechanism to use the extension point and the category.
Alternatively, we could use some feature flag mechanism to switch between the old and the new lookup and change the default mechanism over time.
The text was updated successfully, but these errors were encountered:
When using an interpreter from the generator, the interpreter lookup mechanism uses underlying MPS/IDEA indices and sometimes blocks until the indices can be updated in a separate thread in a read action. If a write action becomes pending in the meantime, the indexing thread cannot acquire the read lock, while the write action cannot proceed until the generator finishes, leading to a deadlock.
Proposed solution:
Change the interpreter lookup mechanism to use the existing InterpreterExtensionPoint (MPS link) and never refer to the interpreter source nodes at run time.
To maintain backwards compatibility, proceed in stages. First, add
getCategory()
method toIInterpreter
and generate it for all interpreters. We can add the method in a backwards compatible fashion by providing a default implementation but existing interpreters will have to be regenerated to return a proper value from this method.Until we can be reasonably sure that all interpreters implement
getCategory()
, we cannot use it for lookups, so as an interim solution, continue looking up interpreters the old way but disable indexing while doing so.After some time has passed, change the look up mechanism to use the extension point and the category.
Alternatively, we could use some feature flag mechanism to switch between the old and the new lookup and change the default mechanism over time.
The text was updated successfully, but these errors were encountered: