Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add global analysis driver pool to protect usages (#3313)
Fixes #3312 If the driver is used in between calls to `changeFile` and before `applyPendingChanges` completes, then you can get `InconsistentAnalysisError`s. This change ensures we won't do that through a new single resource pool shared by all users of the driver. - Guard all accesses to the driver and session with the new resource. - During the resolve, this only grabs the resource once it is fully ready for all of the `changeFile` calls and subsequent call to `applyPendingFileChanges`. This prevents deadlocks compared to a global resolution pool, which may call out to `package:build` apis which can deadlock. - This shouldn't cause significant slowdown, most of the code using the pool has a fixed number of async actions it waits on, and none of those actions might need to wait on a build step to complete (they are all async calls to analyzer apis, not build apis). - Keeps in place the per action resolve pool, still needed for managing updates to `_entryPoints`.
- Loading branch information
Showing
4 changed files
with
100 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters