{"action":"created","issue":{"url":"https://api.github.com/repos/edubkendo/atom-racer/issues/20","labels_url":"https://api.github.com/repos/edubkendo/atom-racer/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/edubkendo/atom-racer/issues/20/comments","events_url":"https://api.github.com/repos/edubkendo/atom-racer/issues/20/events","html_url":"https://github.com/edubkendo/atom-racer/pull/20","id":67483469,"number":20,"title":"EMFILE error fix","user":{"login":"mcanders","id":2694663,"avatar_url":"https://avatars.githubusercontent.com/u/2694663?v=3","gravatar_id":"","url":"https://api.github.com/users/mcanders","html_url":"https://github.com/mcanders","followers_url":"https://api.github.com/users/mcanders/followers","following_url":"https://api.github.com/users/mcanders/following{/other_user}","gists_url":"https://api.github.com/users/mcanders/gists{/gist_id}","starred_url":"https://api.github.com/users/mcanders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcanders/subscriptions","organizations_url":"https://api.github.com/users/mcanders/orgs","repos_url":"https://api.github.com/users/mcanders/repos","events_url":"https://api.github.com/users/mcanders/events{/privacy}","received_events_url":"https://api.github.com/users/mcanders/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-10T01:13:12Z","updated_at":"2015-04-11T14:44:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/edubkendo/atom-racer/pulls/20","html_url":"https://github.com/edubkendo/atom-racer/pull/20","diff_url":"https://github.com/edubkendo/atom-racer/pull/20.diff","patch_url":"https://github.com/edubkendo/atom-racer/pull/20.patch"},"body":"After using atom-racer for awhile in one session, I get an EMFILE error from atom-racer, then the error: \"Cannot read property 'setEncoding' of undefined\" on line 124 of file /usr/share/atom/resources/app/src/buffered-process.js .  EMFILE errors correspond to having too many files open.  It appears that temp.track() only removes the files it created by temp.open() when the process exists, it doesn't automatically close the files while the process is till running.  So if you run atom-racer repeatedly, the amount of open files will increase until your o.s. limit is reached.  Additionally, in the event of a temp.open() error, racer should not be run because it will not have a valid file to read.  I added a fs.close() after fs.writeFileSync() and I haven't seen the error.  I also ensured that racer is only called if temp successfully opens a file."},"comment":{"url":"https://api.github.com/repos/edubkendo/atom-racer/issues/comments/91863581","html_url":"https://github.com/edubkendo/atom-racer/pull/20#issuecomment-91863581","issue_url":"https://api.github.com/repos/edubkendo/atom-racer/issues/20","id":91863581,"user":{"login":"alkama","id":186441,"avatar_url":"https://avatars.githubusercontent.com/u/186441?v=3","gravatar_id":"","url":"https://api.github.com/users/alkama","html_url":"https://github.com/alkama","followers_url":"https://api.github.com/users/alkama/followers","following_url":"https://api.github.com/users/alkama/following{/other_user}","gists_url":"https://api.github.com/users/alkama/gists{/gist_id}","starred_url":"https://api.github.com/users/alkama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alkama/subscriptions","organizations_url":"https://api.github.com/users/alkama/orgs","repos_url":"https://api.github.com/users/alkama/repos","events_url":"https://api.github.com/users/alkama/events{/privacy}","received_events_url":"https://api.github.com/users/alkama/received_events","type":"User","site_admin":false},"created_at":"2015-04-11T14:44:20Z","updated_at":"2015-04-11T14:44:20Z","body":"It's good to me! (Was to be expected that opening a new temp file for each keystroke would have limits.) Thanks for the patch @mcanders :)"}}