{"comment":{"url":"https://api.github.com/repos/catkin/catkin_tools/comments/15538896","html_url":"https://github.com/catkin/catkin_tools/commit/71f1c09ea43befbf808c73d9d0cb60a1500e22c4#commitcomment-15538896","id":15538896,"user":{"login":"wjwwood","id":100427,"avatar_url":"https://avatars.githubusercontent.com/u/100427?v=3","gravatar_id":"","url":"https://api.github.com/users/wjwwood","html_url":"https://github.com/wjwwood","followers_url":"https://api.github.com/users/wjwwood/followers","following_url":"https://api.github.com/users/wjwwood/following{/other_user}","gists_url":"https://api.github.com/users/wjwwood/gists{/gist_id}","starred_url":"https://api.github.com/users/wjwwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjwwood/subscriptions","organizations_url":"https://api.github.com/users/wjwwood/orgs","repos_url":"https://api.github.com/users/wjwwood/repos","events_url":"https://api.github.com/users/wjwwood/events{/privacy}","received_events_url":"https://api.github.com/users/wjwwood/received_events","type":"User","site_admin":false},"position":53,"line":103,"path":"catkin_tools/execution/stages.py","commit_id":"71f1c09ea43befbf808c73d9d0cb60a1500e22c4","created_at":"2016-01-19T19:20:34Z","updated_at":"2016-01-19T19:20:34Z","body":"I've been running `catkin build` over and over again, as well as using ctrl-c and ctrl-\\ randomly while watching the tty in use with `lsof | grep /dev/tty | wc` and the total number of handles in use don't seem to leak between builds. I think that the forked commands which also used these were crashing some how and leaking the file descriptors. I went through and killed what looked like some zombie Python processes which had a handle on several tty's and I stopped running into the issue of running out of pty's. I think what happened was that we ran a failing version that leaked the handles and then suddenly we were running on a machine with like 10 pty's available and that caused the issue to pop up repeatedly and reliably.\r\n\r\nLong story short I think that the combination of not using emulate_tty when calling the env command in the resultspace file along with not calling `catkin env` in that case, but rather `typeset` or something like it, is enough to avoid the problem. Long term I need to verify that `osrf_pycommon` is leaking file handles in normal operation."}}