{"action":"created","issue":{"url":"https://api.github.com/repos/takluyver/terminado/issues/13","labels_url":"https://api.github.com/repos/takluyver/terminado/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/takluyver/terminado/issues/13/comments","events_url":"https://api.github.com/repos/takluyver/terminado/issues/13/events","html_url":"https://github.com/takluyver/terminado/issues/13","id":66776593,"number":13,"title":"Terminal hangs and errs with bad fd","user":{"login":"ellisonbg","id":27600,"avatar_url":"https://avatars.githubusercontent.com/u/27600?v=3","gravatar_id":"","url":"https://api.github.com/users/ellisonbg","html_url":"https://github.com/ellisonbg","followers_url":"https://api.github.com/users/ellisonbg/followers","following_url":"https://api.github.com/users/ellisonbg/following{/other_user}","gists_url":"https://api.github.com/users/ellisonbg/gists{/gist_id}","starred_url":"https://api.github.com/users/ellisonbg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ellisonbg/subscriptions","organizations_url":"https://api.github.com/users/ellisonbg/orgs","repos_url":"https://api.github.com/users/ellisonbg/repos","events_url":"https://api.github.com/users/ellisonbg/events{/privacy}","received_events_url":"https://api.github.com/users/ellisonbg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-07T05:07:27Z","updated_at":"2015-04-08T04:34:26Z","closed_at":null,"body":"When I leave a Terminal open in the IPython Notebook for a long period of time, it eventually stops responding and shows a traceback on the server side:\r\n\r\n```python\r\n[E 2015-04-06 18:40:47.096 ahenriks ioloop:588] Exception in callback (36, <function wrap.<locals>.null_wrapper at 0x7f8869f13f28>)\r\n    Traceback (most recent call last):\r\n      File \"/usr/local/lib/python3.4/dist-packages/tornado/ioloop.py\", line 840, in start\r\n        handler_func(fd_obj, events)\r\n      File \"/usr/local/lib/python3.4/dist-packages/tornado/stack_context.py\", line 275, in null_wrapper\r\n        return fn(*args, **kwargs)\r\n      File \"/usr/local/lib/python3.4/dist-packages/terminado/management.py\", line 187, in pty_read\r\n        s = ptywclients.ptyproc.read(65536)\r\n      File \"/usr/local/lib/python3.4/dist-packages/ptyprocess/ptyprocess.py\", line 803, in read\r\n        b = super(PtyProcessUnicode, self).read(size)\r\n      File \"/usr/local/lib/python3.4/dist-packages/ptyprocess/ptyprocess.py\", line 507, in read\r\n        s = self.fileobj.read(size)\r\n    OSError: [Errno 9] Bad file descriptor\r\n```\r\n\r\nThe odd thing is that these are raised at the rate of a hundreds/thousands a minute. Not sure if this is an issue with terminado or ptyprocess."},"comment":{"url":"https://api.github.com/repos/takluyver/terminado/issues/comments/90800180","html_url":"https://github.com/takluyver/terminado/issues/13#issuecomment-90800180","issue_url":"https://api.github.com/repos/takluyver/terminado/issues/13","id":90800180,"user":{"login":"ellisonbg","id":27600,"avatar_url":"https://avatars.githubusercontent.com/u/27600?v=3","gravatar_id":"","url":"https://api.github.com/users/ellisonbg","html_url":"https://github.com/ellisonbg","followers_url":"https://api.github.com/users/ellisonbg/followers","following_url":"https://api.github.com/users/ellisonbg/following{/other_user}","gists_url":"https://api.github.com/users/ellisonbg/gists{/gist_id}","starred_url":"https://api.github.com/users/ellisonbg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ellisonbg/subscriptions","organizations_url":"https://api.github.com/users/ellisonbg/orgs","repos_url":"https://api.github.com/users/ellisonbg/repos","events_url":"https://api.github.com/users/ellisonbg/events{/privacy}","received_events_url":"https://api.github.com/users/ellisonbg/received_events","type":"User","site_admin":false},"created_at":"2015-04-08T04:34:26Z","updated_at":"2015-04-08T04:34:26Z","body":"Yes, this is a linux system.\n\nOn Tue, Apr 7, 2015 at 8:03 PM, Thomas Kluyver <notifications@github.com>\nwrote:\n\n> Good point.\n>\n> If the child closes the tty, the parent should get EIO when it tries to\n> read. I *think* EBADF means that something has closed the fd from the\n> parent (server) side without going through terminado/pexpect.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/takluyver/terminado/issues/13#issuecomment-90790242>.\n>\n\n\n\n-- \nBrian E. Granger\nCal Poly State University, San Luis Obispo\n@ellisonbg on Twitter and GitHub\nbgranger@calpoly.edu and ellisonbg@gmail.com\n"}}