Prepare to work with newer PSES versions #156
Merged
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.
#104 uncovered several issues in how we work with PSES.
First of all, our delayed process output reading strategy seemingly blocked the PSES process from starting.
Before this PR, our PSES startup routine was the following:
The current bundled PSES version (v1.10.1, I think?) is okay with this: it will happily write the session file and then start writing some bits of diagnostic output to its stdout.
But v3.12.0 is different. It really insists on writing the output first, and then opening the file.
But we do not read the stdout pipe before we see the file on disk! And thus its
Console.Write
(or whatever they are using) gets blocked on us. And we are waiting for them. A classical deadlock, albeit distributed between the two processes.I fixed that by starting processing the process output pipes right after its startup.
And then, a second issue appeared: new PSES opens its LSP pipe with exclusive write access (seemingly it wasn't the case before). And we had a small snippet that tried to open the diagnostic pipe with a bit too wide permission (it requested write access to the pipe that's only meant to be written by the PSES process, not ours). Which caused a file access violation.
Both of the issues are fixed, but PSES still doesn't work: I think it uses a protocol newer than supported by our LSP library version.
So, I am going to close #104 by this PR, but process the remaining work on updating PSES in #51, as planned before.