{"action":"created","issue":{"url":"https://api.github.com/repos/kennethreitz/pipenv/issues/1023","repository_url":"https://api.github.com/repos/kennethreitz/pipenv","labels_url":"https://api.github.com/repos/kennethreitz/pipenv/issues/1023/labels{/name}","comments_url":"https://api.github.com/repos/kennethreitz/pipenv/issues/1023/comments","events_url":"https://api.github.com/repos/kennethreitz/pipenv/issues/1023/events","html_url":"https://github.com/kennethreitz/pipenv/issues/1023","id":270729730,"number":1023,"title":"Pipenv is really slow to exit if the network is not working","user":{"login":"anowlcalledjosh","id":9433472,"avatar_url":"https://avatars1.githubusercontent.com/u/9433472?v=4","gravatar_id":"","url":"https://api.github.com/users/anowlcalledjosh","html_url":"https://github.com/anowlcalledjosh","followers_url":"https://api.github.com/users/anowlcalledjosh/followers","following_url":"https://api.github.com/users/anowlcalledjosh/following{/other_user}","gists_url":"https://api.github.com/users/anowlcalledjosh/gists{/gist_id}","starred_url":"https://api.github.com/users/anowlcalledjosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anowlcalledjosh/subscriptions","organizations_url":"https://api.github.com/users/anowlcalledjosh/orgs","repos_url":"https://api.github.com/users/anowlcalledjosh/repos","events_url":"https://api.github.com/users/anowlcalledjosh/events{/privacy}","received_events_url":"https://api.github.com/users/anowlcalledjosh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2017-11-02T16:56:39Z","updated_at":"2017-11-03T03:34:02Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"When the network is very slow, Pipenv takes an extremely long time to exit after doing almost anything (e.g. `pipenv` will print the usage message, and then block for a while – but `pipenv --help` will behave as normal).\r\n\r\n##### Describe your environment\r\n\r\n1. OS Type: Ubuntu 16.04\r\n1. Python version: 3.6.3\r\n1. Pipenv version: 8.3.1, installed via pipsi\r\n\r\nHere is the result of `pip list` in the virtualenv that Pipenv is installed in:\r\n\r\n```\r\nPackage          Version    \r\n---------------- -----------\r\ncertifi          2017.7.27.1\r\nchardet          3.0.4      \r\nflake8           3.5.0      \r\nidna             2.6        \r\nmccabe           0.6.1      \r\npew              1.1.0      \r\npip              9.0.1      \r\npipenv           8.3.1      \r\npycodestyle      2.3.1      \r\npyflakes         1.6.0      \r\nrequests         2.18.4     \r\nsetuptools       36.6.0     \r\nurllib3          1.22       \r\nvirtualenv       15.1.0     \r\nvirtualenv-clone 0.2.6      \r\nwheel            0.30.0\r\n```\r\n\r\n##### Expected result\r\n\r\nPipenv shouldn't suddenly take longer to exit because the network is behaving strangely.\r\n\r\n##### Actual result\r\n\r\nIf the network is slow, it takes almost exactly 21 seconds to run many Pipenv commands, including:\r\n\r\n- `pipenv`\r\n- `pipenv --completion`\r\n\r\nbut *not* `pipenv --help` (finishes in about 1 second, regardless of network state AFAICT).\r\n\r\nIf I press ctrl-C after running `pipenv`, when it has printed the usage message but not yet exited, I get a traceback like this:\r\n\r\n```\r\nError in atexit._run_exitfuncs:\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python3.6/concurrent/futures/thread.py\", line 40, in _python_exit\r\n    t.join()\r\n  File \"/usr/lib/python3.6/threading.py\", line 1056, in join\r\n    self._wait_for_tstate_lock()\r\n  File \"/usr/lib/python3.6/threading.py\", line 1072, in _wait_for_tstate_lock\r\n    elif lock.acquire(block, timeout):\r\nKeyboardInterrupt\r\nException ignored in: <function ThreadPoolExecutor._adjust_thread_count.<locals>.weakref_cb at 0x7fce19f11a60>\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python3.6/concurrent/futures/thread.py\", line 131, in weakref_cb\r\n  File \"/usr/lib/python3.6/queue.py\", line 145, in put\r\n  File \"/usr/lib/python3.6/threading.py\", line 347, in notify\r\nTypeError: 'NoneType' object is not callable\r\n```\r\n\r\n##### Steps to replicate\r\n\r\n~~Have a WiFi card that randomly decides to stop working~~ Run `sudo tc qdisc add dev INTERFACE root netem delay 10s` (where `INTERFACE` might be something like `wlp2s0` – obtain it from either `ip link` or `ifconfig`) to add a 10s delay to all your traffic, then run `pipenv`.\r\n\r\nThe delay can then be removed with `sudo tc qdisc del dev INTERFACE root netem`.\r\n\r\n[Source for these commands](http://bencane.com/2012/07/16/tc-adding-simulated-network-latency-to-your-linux-server/)"},"comment":{"url":"https://api.github.com/repos/kennethreitz/pipenv/issues/comments/341615971","html_url":"https://github.com/kennethreitz/pipenv/issues/1023#issuecomment-341615971","issue_url":"https://api.github.com/repos/kennethreitz/pipenv/issues/1023","id":341615971,"user":{"login":"techalchemy","id":954310,"avatar_url":"https://avatars0.githubusercontent.com/u/954310?v=4","gravatar_id":"","url":"https://api.github.com/users/techalchemy","html_url":"https://github.com/techalchemy","followers_url":"https://api.github.com/users/techalchemy/followers","following_url":"https://api.github.com/users/techalchemy/following{/other_user}","gists_url":"https://api.github.com/users/techalchemy/gists{/gist_id}","starred_url":"https://api.github.com/users/techalchemy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/techalchemy/subscriptions","organizations_url":"https://api.github.com/users/techalchemy/orgs","repos_url":"https://api.github.com/users/techalchemy/repos","events_url":"https://api.github.com/users/techalchemy/events{/privacy}","received_events_url":"https://api.github.com/users/techalchemy/received_events","type":"User","site_admin":false},"created_at":"2017-11-03T03:34:02Z","updated_at":"2017-11-03T03:34:02Z","author_association":"COLLABORATOR","body":"@erinxocon would that still work if the user edits it by hand? Or if they run `pipenv install <x>` but it doesn't also check for updates?"}}
{"actor":{"display_login":"techalchemy"}}