Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

hie-8.6.4/8.4.4 stalls after 3-4 requests #1216

Closed
bscottm opened this issue Apr 28, 2019 · 7 comments
Closed

hie-8.6.4/8.4.4 stalls after 3-4 requests #1216

bscottm opened this issue Apr 28, 2019 · 7 comments
Milestone

Comments

@bscottm
Copy link

bscottm commented Apr 28, 2019

I hesitated to open this in a new issue, looking for closely related issues to ensure that the issue list doesn't get overly cluttered... HIE stalls after a 3-4 requests. At first I thought the problem was with SublimeText, the LSP package and the Windows implementation of pipes. I tried hie-8.6.4 under Linux on VirtualBox, same problem. It seems to take about three or four JSON RPCs before hie-8.6.4 stalls.

LSP's basic loop calls Python's str.readline() to grab the next line of input looking for the "Content-length" header. That just stalls waiting for input. At first I thought that it might be a closed file descriptor, but I would expect the str.readline() loop to return EOF (an empty string.)

This particular problem showed up about two to three weeks ago, and I've been trying to diagnose it when I can free cycles. I'm on the latest github version with submodules synced. hie-wrapper log is attached, although I anonymized some of my paths. Apologies for the big source file that gets downloaded to the server...

hie-wrapper.log

@mpickering
Copy link
Collaborator

This looks quite clear cut, the last message of the log is:

{"code":-32603,"message":"haskell-lsp:parse error. Object (fromList [(\"jsonrpc\",String \"2.0\"),(\"method\",String \"shutdown\"),(\"id\",Number 10.0)]) \"When parsing the record RequestMessage of type Language.Haskell.LSP.Types.Message.RequestMessage the key params was not present.\" `stack update` and install new haskell-lsp. Or check information on https://marketplace.visualstudio.com/items?itemName=xxxxxxxxxxxxxxx"},"jsonrpc":"2.0","id":10}

Any ideas whose fault this is @bubba ?

@bscottm
Copy link
Author

bscottm commented Apr 28, 2019

@mpickering: Wait a sec. The last message lacks key attribute, which, coincidentally, happens to be the last message ever sent to hie when the editor exits.

I'm not so sure that this is quite so clear cut, if none of the hover requests return a response. hie stops responding after request id 4.

@Anrock
Copy link
Collaborator

Anrock commented Apr 28, 2019

@bscottm can you check if this edit helps?

@lukel97
Copy link
Collaborator

lukel97 commented Apr 28, 2019

@mpickering that parsing issue looks like it’s our fault, specifically Haskell-lsp-types. The specification does allow for null to be set for the params field of a request, so https://hackage.haskell.org/package/haskell-lsp-types-0.11.0.0/docs/Language-Haskell-LSP-Types.html#t:RequestMessage should really be Maybe params. This is going to need a lot of changes though throughout haskell-ide-engine. It might be better just to have a custom FromJSON instance for ShutdownRequest

@bscottm
Copy link
Author

bscottm commented Apr 28, 2019

@bscottm can you check if this edit helps?

Yes, tremendously. Slow as molasses, but at least hie responds. 2.5G hie process (it's an EMACS: "Eight megs and constantly swapping" so that saying went many years ago.)

@Anrock
Copy link
Collaborator

Anrock commented Apr 29, 2019

Welp, so this could be just another case of #983 (if it's even a single issue). Personally i'm running HIE with this edit since then.

@bscottm
Copy link
Author

bscottm commented Apr 29, 2019

@Anrock: So long as cabal-helper doesn't change in the near future, there's no danger of the cabal-helper.cabal being changed or merged, so I shouldn't get unexpected surprises.

@bscottm bscottm closed this as completed Apr 29, 2019
@alanz alanz added this to the 2019-04 milestone May 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants