This repository was archived by the owner on Oct 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 204
This repository was archived by the owner on Oct 7, 2020. It is now read-only.
Scheduler lockup #1017
Copy link
Copy link
Closed
Description
See haskell/vscode-haskell#129.
The sequence of events is start with a file that typechecks, edit it so it doesn't, send in code action requests, which all defer. Once the module finishes its failed compilation, we lock up iterating the same request until the next code action request comes in, at which point the ide scheduler goes AWOL.
e.g.
2018-12-30 22:34:30.529177145 [ThreadId 14] - setTypecheckedModule: after ghc-mod
2018-12-30 22:34:30.529305819 [ThreadId 14] - setTypecheckedModule: Didn't get typechecked or parsed module for: "/tmp/fff/test2.hs"
2018-12-30 22:34:30.529662424 [ThreadId 14] - setTypecheckedModule: errs: []
2018-12-30 22:34:30.529721838 [ThreadId 14] - ghcDispatcher: top of loop
2018-12-30 22:34:30.529810041 [ThreadId 6] - <--2--{"jsonrpc":"2.0","params":{"uri":"file:///tmp/fff/test2.hs","diagnostics":[{"severity":1,"range":{"start":{"line":0,"character":0},"end":{"line":1,"character":0}},"source":"ghcmod","message":""},{"severity":1,"range":{"start":{"line":13,"character":12},"end":{"line":13,"character":13}},"source":"ghcmod","message":"parse error on input ‘=’\nPerhaps you need a 'let' in a 'do' block?\ne.g. 'let x = 5' instead of 'x = 5'"}]},"method":"textDocument/publishDiagnostics"}
2018-12-30 22:34:30.539631721 [ThreadId 4] - ---> {"jsonrpc":"2.0","id":59,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///tmp/fff/test2.hs"},"range":{"start":{"line":0,"character":0},"end":{"line":14,"character":0}},"context":{"diagnostics":[{"range":{"start":{"line":0,"character":0},"end":{"line":1,"character":0}},"message":"","severity":1,"source":"ghcmod"},{"range":{"start":{"line":13,"character":12},"end":{"line":13,"character":13}},"message":"parse error on input ‘=’\nPerhaps you need a 'let' in a 'do' block?\ne.g. 'let x = 5' instead of 'x = 5'","severity":1,"source":"ghcmod"}]}}}
2018-12-30 22:34:30.539858334 [ThreadId 13] - ****** reactor: got message number:64
2018-12-30 22:34:30.53990388 [ThreadId 13] - reactor:got CodeActionRequest:RequestMessage {_jsonrpc = "2.0", _id = IdInt 59, _method = TextDocumentCodeAction, _params = CodeActionParams {_textDocument = TextDocumentIdentifier {_uri = Uri {getUri = "file:///tmp/fff/test2.hs"}}, _range = Range {_start = Position {_line = 0, _character = 0}, _end = Position {_line = 14, _character = 0}}, _context = CodeActionContext {_diagnostics = List [Diagnostic {_range = Range {_start = Position {_line = 0, _character = 0}, _end = Position {_line = 1, _character = 0}}, _severity = Just DsError, _code = Nothing, _source = Just "ghcmod", _message = "", _relatedInformation = Nothing},Diagnostic {_range = Range {_start = Position {_line = 13, _character = 12}, _end = Position {_line = 13, _character = 13}}, _severity = Just DsError, _code = Nothing, _source = Just "ghcmod", _message = "parse error on input \8216=\8217\nPerhaps you need a 'let' in a 'do' block?\ne.g. 'let x = 5' instead of 'x = 5'", _relatedInformation = Nothing}], only = Nothing}}}
2018-12-30 22:34:30.54021847 [ThreadId 15] - ideDispatcher: got request 64 with id: IdInt 59
2018-12-30 22:34:30.540258161 [ThreadId 15] - ideDispatcher:doing action for (tn,lid):(64,IdInt 59)
2018-12-30 22:34:30.540281603 [ThreadId 15] - handleCodeActionReq:getProviders called
2018-12-30 22:34:30.540300721 [ThreadId 15] - ideDispatcher:action done for (tn,lid):(64,IdInt 59)
2018-12-30 22:34:30.540318966 [ThreadId 15] - ideDispatcher:after unlessCancelled for (tn,lid):(64,IdInt 59)
2018-12-30 22:34:30.540339769 [ThreadId 15] - handleCodeActionReq:providersCb called
2018-12-30 22:34:30.540359111 [ThreadId 15] - ideDispatcher: top of loop
2018-12-30 22:34:30.540377116 [ThreadId 15] - ideDispatcher: got request 64 with id: IdInt 59
2018-12-30 22:34:30.540394971 [ThreadId 15] - ideDispatcher:doing action for (tn,lid):(64,IdInt 59)
2018-12-30 22:34:30.54041432 [ThreadId 15] - ideDispatcher:action done for (tn,lid):(64,IdInt 59)
2018-12-30 22:34:30.540439504 [ThreadId 15] - ideDispatcher:after unlessCancelled for (tn,lid):(64,IdInt 59)
2018-12-30 22:34:30.540460636 [ThreadId 15] - ideDispatcher: top of loop
2018-12-30 22:34:30.54047776 [ThreadId 15] - ideDispatcher: got request 64 with id: IdInt 59
2018-12-30 22:34:30.540495844 [ThreadId 15] - ideDispatcher:doing action for (tn,lid):(64,IdInt 59)
2018-12-30 22:34:30.540514211 [ThreadId 15] - ideDispatcher:action done for (tn,lid):(64,IdInt 59)
2018-12-30 22:34:30.540531694 [ThreadId 15] - ideDispatcher:after unlessCancelled for (tn,lid):(64,IdInt 59)
2018-12-30 22:34:30.540550131 [ThreadId 15] - ideDispatcher: top of loop
2018-12-30 22:34:30.54056678 [ThreadId 15] - ideDispatcher: got request 64 with id: IdInt 59
2018-12-30 22:34:30.540584022 [ThreadId 15] - ideDispatcher:doing action for (tn,lid):(64,IdInt 59)
2018-12-30 22:34:30.540651196 [ThreadId 15] - ideDispatcher:action done for (tn,lid):(64,IdInt 59)
2018-12-30 22:34:30.540675208 [ThreadId 15] - ideDispatcher:after unlessCancelled for (tn,lid):(64,IdInt 59)
2018-12-30 22:34:30.540696167 [ThreadId 15] - ideDispatcher: top of loop
2018-12-30 22:34:30.540713884 [ThreadId 15] - ideDispatcher: got request 64 with id: IdInt 59
2018-12-30 22:34:30.540732213 [ThreadId 15] - ideDispatcher:doing action for (tn,lid):(64,IdInt 59)
2018-12-30 22:34:30.540759387 [ThreadId 15] - ideDispatcher:action done for (tn,lid):(64,IdInt 59)
2018-12-30 22:34:30.540779155 [ThreadId 15] - ideDispatcher:after unlessCancelled for (tn,lid):(64,IdInt 59)
2018-12-30 22:34:30.540798207 [ThreadId 15] - ideDispatcher: top of loop
2018-12-30 22:34:30.540814831 [ThreadId 15] - ideDispatcher: got request 64 with id: IdInt 59
2018-12-30 22:34:30.540832024 [ThreadId 15] - ideDispatcher:doing action for (tn,lid):(64,IdInt 59)
2018-12-30 22:34:30.540851308 [ThreadId 15] - ideDispatcher:action done for (tn,lid):(64,IdInt 59)
2018-12-30 22:34:30.540868809 [ThreadId 15] - ideDispatcher:after unlessCancelled for (tn,lid):(64,IdInt 59)
2018-12-30 22:34:30.540886884 [ThreadId 15] - ideDispatcher: top of loop
2018-12-30 22:34:30.54090324 [ThreadId 15] - ideDispatcher: got request 64 with id: IdInt 59
2018-12-30 22:34:30.540960765 [ThreadId 15] - ideDispatcher:doing action for (tn,lid):(64,IdInt 59)
2018-12-30 22:34:30.54100262 [ThreadId 15] - ideDispatcher:action done for (tn,lid):(64,IdInt 59)
2018-12-30 22:34:30.541021132 [ThreadId 15] - ideDispatcher:after unlessCancelled for (tn,lid):(64,IdInt 59)
2018-12-30 22:34:30.785119197 [ThreadId 4] - ---> {"jsonrpc":"2.0","id":60,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///tmp/fff/test2.hs"},"range":{"start":{"line":12,"character":2},"end":{"line":12,"character":2}},"context":{"diagnostics":[]}}}
From then on, there are no further responses from the server.