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
Avoid race conditions with VFS and VFS versions (#2789)
* Avoid race conditions with VFS and VFS version
We need to take VFS snapshots as soon as we get a change notification.
Consider the following interleaving of events:
1. Change Notification A (updates LSP VFS)
2. Restart Shake Session (A changed) initiated
3. Change Notification B (updates LSP VFS)
4. Restart Shake Session (A changed) takes VFS snapshot and possibly performs more computation
5. Restart Shake Session (B changed)
In particular, between step 3 and 5, we took a snapshot for a previous build,
but this snapshot included changes from a newer VFS state that the build should
not have seen.
To fix this, we need to take snapshots as soon as a notification handler is
called, before forking any threads. This works because LSP calls all handlers
in a single threaded fashion and these handlers block message processing. It
is essential to this on the LSP handler thread rather than the reactor thread
that GHCIDE sets up in order to maintin the property.
* Disable flaky test 'add missing module (non workspace)'
0 commit comments