haskell-language-server/exe
wz1000 3c24c20c5d
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)'
2022-04-16 20:43:44 +00:00
..
Main.hs Avoid race conditions with VFS and VFS versions (#2789) 2022-04-16 20:43:44 +00:00
Plugins.hs Change Type Signature Plugin (#2660) 2022-03-03 23:08:42 +00:00
Wrapper.hs Fix the tower of Babel (#2757) 2022-03-06 21:24:51 +00:00