-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Commit(s) to merge
- https://dart-review.googlesource.com/c/sdk/+/381460
- https://dart-review.googlesource.com/c/sdk/+/381481
- https://dart-review.googlesource.com/c/sdk/+/381860
Target
stable
Prepared changelist for beta/stable
https://dart-review.googlesource.com/c/sdk/+/381760
Issue Description
Recent changes to the analysis server result in fewer analysis contexts being created to improve performance. Analysis contexts were also used by analysis server plugins and when no analysis context is created at the location where a plugin should be enabled, it would instead be enabled for the parent context, resulting in the wrong folders having the plugins enabled, and potentially triggering a race condition because the same plugin may be assigned to the same root multiple times.
The result was that analysis server plugins could be nonfunctional, or given the wrong root folders to analyze.
What is the fix
This fix is to ensure that analysis contexts are created at all locations where plugins are enabled (or changed from the parent context).
Why cherry-pick
Without the cherry pick, analysis server plugins may not work at all, or may be enabled for folders that they should not (potentially producing spurious results).
Risk
Medium? I'm not sure what the scale is here. It's not the most trivial cherry-pick, however the changes in behaviour should be limited to only when plugins are used (although the extra check for plugins applies to all contexts) and the change includes several new tests covering the reported error conditions and some additional cases.
(cc @bwilkerson @srawlins @pq in case they have opinions on this)
Issue link(s)
Extra Info
No response