{"action":"created","issue":{"url":"https://api.github.com/repos/atom/atom-languageclient/issues/130","repository_url":"https://api.github.com/repos/atom/atom-languageclient","labels_url":"https://api.github.com/repos/atom/atom-languageclient/issues/130/labels{/name}","comments_url":"https://api.github.com/repos/atom/atom-languageclient/issues/130/comments","events_url":"https://api.github.com/repos/atom/atom-languageclient/issues/130/events","html_url":"https://github.com/atom/atom-languageclient/issues/130","id":270103268,"number":130,"title":"Connection to server gets silently closed","user":{"login":"JakeBecker","id":547940,"avatar_url":"https://avatars3.githubusercontent.com/u/547940?v=4","gravatar_id":"","url":"https://api.github.com/users/JakeBecker","html_url":"https://github.com/JakeBecker","followers_url":"https://api.github.com/users/JakeBecker/followers","following_url":"https://api.github.com/users/JakeBecker/following{/other_user}","gists_url":"https://api.github.com/users/JakeBecker/gists{/gist_id}","starred_url":"https://api.github.com/users/JakeBecker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JakeBecker/subscriptions","organizations_url":"https://api.github.com/users/JakeBecker/orgs","repos_url":"https://api.github.com/users/JakeBecker/repos","events_url":"https://api.github.com/users/JakeBecker/events{/privacy}","received_events_url":"https://api.github.com/users/JakeBecker/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2017-10-31T20:12:36Z","updated_at":"2017-11-09T14:04:42Z","closed_at":null,"author_association":"NONE","body":"I've been working on a plugin for Elixir, and I've not encountered this problem in VS Code (nor has it been reported by users), so I'm assuming it has something to do with the client code, though I've not had much success in debugging it. After handling some number of requests successfully, the language server logs an EPIPE error which indicates that it can't write to stdio because it got a SIGPIPE signal.\r\n\r\nIn the client, what you see (when the message tracing is enabled) is that requests are being sent and responded to, but after some number of requests, a request is sent and no response received. Upon the next notification or request sent after that, the client immediately crashes with an error \"Uncaught Error: Connection is closed.\"\r\n\r\nThis should be reproducible, though you'll need Elixir installed to run the language server. To reproduce, check out this repo recursively: https://github.com/JakeBecker/ide-elixir .  Then run `npm run prepare` to compile the language server. If you open a project and use it normally for a while, do some auto complete requests, etc., you'll get the above behavior.\r\n\r\nAt a minimum, the client ought to log something when the connection gets closed. "},"comment":{"url":"https://api.github.com/repos/atom/atom-languageclient/issues/comments/343163789","html_url":"https://github.com/atom/atom-languageclient/issues/130#issuecomment-343163789","issue_url":"https://api.github.com/repos/atom/atom-languageclient/issues/130","id":343163789,"user":{"login":"alexheretic","id":2331607,"avatar_url":"https://avatars0.githubusercontent.com/u/2331607?v=4","gravatar_id":"","url":"https://api.github.com/users/alexheretic","html_url":"https://github.com/alexheretic","followers_url":"https://api.github.com/users/alexheretic/followers","following_url":"https://api.github.com/users/alexheretic/following{/other_user}","gists_url":"https://api.github.com/users/alexheretic/gists{/gist_id}","starred_url":"https://api.github.com/users/alexheretic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexheretic/subscriptions","organizations_url":"https://api.github.com/users/alexheretic/orgs","repos_url":"https://api.github.com/users/alexheretic/repos","events_url":"https://api.github.com/users/alexheretic/events{/privacy}","received_events_url":"https://api.github.com/users/alexheretic/received_events","type":"User","site_admin":false},"created_at":"2017-11-09T14:04:42Z","updated_at":"2017-11-09T14:04:42Z","author_association":"CONTRIBUTOR","body":"One issue is that you should avoid using `child_process.exec` to run language servers, because it has a limited stdout/stderr buffer. If the default 200K buffer overflows the process will be terminated.\r\n\r\nInstead use `child_process.spawn` which uses streams. [Read more](https://www.hacksparrow.com/difference-between-spawn-and-exec-of-node-js-child_process.html).\r\n\r\n```js\r\n// ide-elixir.js\r\n...\r\nreturn cp.exec(\"mix elixir_ls.language_server\", {env: env});\r\n...\r\n```\r\n\r\nPerhaps we should add a note to `AutoLanguageClient.prototype.startServerProcess` src?\r\n"}}
{"actor":{"display_login":"alexheretic"}}