{"action":"created","issue":{"url":"https://api.github.com/repos/mitsuhiko/flask/issues/1304","labels_url":"https://api.github.com/repos/mitsuhiko/flask/issues/1304/labels{/name}","comments_url":"https://api.github.com/repos/mitsuhiko/flask/issues/1304/comments","events_url":"https://api.github.com/repos/mitsuhiko/flask/issues/1304/events","html_url":"https://github.com/mitsuhiko/flask/issues/1304","id":53240508,"number":1304,"title":"Dev server fails to terminate, becomes zombie","user":{"login":"hexturtle","id":9427813,"avatar_url":"https://avatars.githubusercontent.com/u/9427813?v=3","gravatar_id":"","url":"https://api.github.com/users/hexturtle","html_url":"https://github.com/hexturtle","followers_url":"https://api.github.com/users/hexturtle/followers","following_url":"https://api.github.com/users/hexturtle/following{/other_user}","gists_url":"https://api.github.com/users/hexturtle/gists{/gist_id}","starred_url":"https://api.github.com/users/hexturtle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hexturtle/subscriptions","organizations_url":"https://api.github.com/users/hexturtle/orgs","repos_url":"https://api.github.com/users/hexturtle/repos","events_url":"https://api.github.com/users/hexturtle/events{/privacy}","received_events_url":"https://api.github.com/users/hexturtle/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-02T07:10:42Z","updated_at":"2015-01-13T14:56:01Z","closed_at":null,"body":"Running OS X Yosemite.\r\nI had the dev server running and was toggling the debug option. i.e. app.debug={True, False} in my entry-point file.\r\n\r\nI started running without debug and was surprised that the server was loading changes I made to my templates without having to restart the server. I'm new to Flask, and read in the Quickstart that debug had to be turned on for this to happen. Though, I've since concluded that debug being on is only necessary for the actual application code to be reloaded, and that template code will always be reloaded (which makes sense) without having to restart the server.\r\n\r\nIn any case, I proceeded to set debug to True and save the entry-point file. I may have restarted the server at this point, but either way things were still fine. However, trouble ensued when I then commented the line setting debug to True (thus leaving it set to the default value) and saving. After this, I restarted the server, but was met with a traceback ending in:\r\n\r\n```\r\n...\r\nFile \"/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py\", line 224, in meth\r\n    return getattr(self._sock,name)(*args)\r\nsocket.error: [Errno 48] Address already in use\r\n```\r\n\r\nI restarted the server multiple times, before and after relaunching the Terminal app, and was met with this traceback each time. From this I suspected that the server process was still running as a zombie. Using Activity Monitor, I found a python process running and terminated it. After that, when I tried running the dev server, I received a smaller (though similarly-ending) traceback. (not sure what to conclude from receiving a different traceback)\r\n\r\nI didn't get to do much more testing after that. I came to GitHub to begin documenting the bug when my MacBook suddenly restarted. I can't say for certain that the restart is related to this issue. However, the restart was due to an OS panic relating to OSXFuse. I've never had an OS panic since updating to Yosemite, so I find a correlation to the dev server issue likely."},"comment":{"url":"https://api.github.com/repos/mitsuhiko/flask/issues/comments/69755821","html_url":"https://github.com/mitsuhiko/flask/issues/1304#issuecomment-69755821","issue_url":"https://api.github.com/repos/mitsuhiko/flask/issues/1304","id":69755821,"user":{"login":"rahulrrixe","id":3780511,"avatar_url":"https://avatars.githubusercontent.com/u/3780511?v=3","gravatar_id":"","url":"https://api.github.com/users/rahulrrixe","html_url":"https://github.com/rahulrrixe","followers_url":"https://api.github.com/users/rahulrrixe/followers","following_url":"https://api.github.com/users/rahulrrixe/following{/other_user}","gists_url":"https://api.github.com/users/rahulrrixe/gists{/gist_id}","starred_url":"https://api.github.com/users/rahulrrixe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rahulrrixe/subscriptions","organizations_url":"https://api.github.com/users/rahulrrixe/orgs","repos_url":"https://api.github.com/users/rahulrrixe/repos","events_url":"https://api.github.com/users/rahulrrixe/events{/privacy}","received_events_url":"https://api.github.com/users/rahulrrixe/received_events","type":"User","site_admin":false},"created_at":"2015-01-13T14:56:01Z","updated_at":"2015-01-13T14:56:01Z","body":"You are getting this because because the socket on which the flask app was running is still running in daemon mode. It generally happens when you uses <code> control + Z </code> to stop the flask server instead try using <code> control + C </code>.\r\n\r\nTo see the process id and kill it, type these commands in your Mac terminal\r\n```bash\r\n$ losf -i:PORT         #flask app PORT correspond to 5000\r\n$ kill -9 pid\r\n```\r\n"}}