Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid race conditions with VFS and VFS versions #2789

Merged
merged 2 commits into from
Apr 16, 2022
Merged

Commits on Apr 15, 2022

  1. 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.
    wz1000 committed Apr 15, 2022
    Configuration menu
    Copy the full SHA
    5dc9af3 View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2022

  1. Configuration menu
    Copy the full SHA
    0b2821f View commit details
    Browse the repository at this point in the history