-
-
Notifications
You must be signed in to change notification settings - Fork 389
Lockless diagnostics #2434
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
Lockless diagnostics #2434
Conversation
-> STM (IO ()) | ||
recordDirtyKeys ShakeExtras{dirtyKeys} key file = do | ||
modifyTVar' dirtyKeys $ \x -> foldl' (flip HSet.insert) x (toKey key <$> file) | ||
return $ withEventTrace "recordDirtyKeys" $ \addEvent -> do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm interesting. I guess we may end up with this happening a bit if we push STM out further and we hit more places where we want to do tracing. I wonder if this is a pattern that appears elsewhere: this is something like a "final" IO action that should be run only after the STM action succeeds.
Stderr output is very useful to diagnose test failures when interleaved with the LSP log. Sending it to a file disrupts this interleaving and makes it harder to retrieve from CI
b802fcb
to
43220a0
Compare
let invalidateShakeCache = do | ||
void $ modifyVar' version succ | ||
recordDirtyKeys extras GhcSessionIO [emptyFilePath] | ||
atomically $ recordDirtyKeys extras GhcSessionIO [emptyFilePath] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed, this changes the type of invalidateShakeCache
to :: IO (IO ())
. I suppose that is unintentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, either we need a join
or have to consume the action produced at: https://github.com/haskell/haskell-language-server/pull/2434/files#diff-d7140bbfca1b7aaafd8c82d1d6aa21a3f941eb27ba8f08e4d9fb13766b21b418L393
Fourth instalment of #2357