Keep communication pipes between lsp-test and ghcide alive for the entire test#4892
Merged
crtschin merged 1 commit intohaskell:masterfrom Apr 13, 2026
Merged
Conversation
12c5da3 to
1275248
Compare
Collaborator
Author
|
So on the plus side, I don't see errors related to a closed handle anymore (no |
1275248 to
b636323
Compare
Collaborator
b636323 to
79b0a04
Compare
fendor
approved these changes
Apr 13, 2026
Collaborator
fendor
left a comment
There was a problem hiding this comment.
LGTM!
In the comment, could you explain where the read is happening?
It doesn't look trivial.
79b0a04 to
03b823e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4884.
Because the pipe is split up into separate handles and sent off to the separate component calls to lsp-test (async through ghcide in in-thread to lsp-test directly to communicate the test messages), a GC when either is in the process of being shutdown, will close one end of the pipe. This forms a race condition where the other end of the pipe hasn't been terminated and now unexpectedly reads a EOF.
For a more comprehensive explanation see my previous attempt at fixing this via
lsp-testby being lenient on shutdown. I think this PR is nicer compared to that one, as it tackles the core issue, the handles being GC'd prematurely.