{"action":"created","issue":{"url":"https://api.github.com/repos/zeromq/pyzmq/issues/537","repository_url":"https://api.github.com/repos/zeromq/pyzmq","labels_url":"https://api.github.com/repos/zeromq/pyzmq/issues/537/labels{/name}","comments_url":"https://api.github.com/repos/zeromq/pyzmq/issues/537/comments","events_url":"https://api.github.com/repos/zeromq/pyzmq/issues/537/events","html_url":"https://github.com/zeromq/pyzmq/issues/537","id":32254084,"number":537,"title":"LINGER broken on Python 3.4.0?","user":{"login":"CleanCut","id":5838512,"avatar_url":"https://avatars.githubusercontent.com/u/5838512?v=3","gravatar_id":"","url":"https://api.github.com/users/CleanCut","html_url":"https://github.com/CleanCut","followers_url":"https://api.github.com/users/CleanCut/followers","following_url":"https://api.github.com/users/CleanCut/following{/other_user}","gists_url":"https://api.github.com/users/CleanCut/gists{/gist_id}","starred_url":"https://api.github.com/users/CleanCut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CleanCut/subscriptions","organizations_url":"https://api.github.com/users/CleanCut/orgs","repos_url":"https://api.github.com/users/CleanCut/repos","events_url":"https://api.github.com/users/CleanCut/events{/privacy}","received_events_url":"https://api.github.com/users/CleanCut/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2014-04-25T18:08:25Z","updated_at":"2016-11-09T15:49:34Z","closed_at":"2014-04-25T19:41:21Z","body":"Using python 3.4.0 on OS X 10.9.2 (Mavericks) OR on CentOS 6.5 (fully patched), I can't get ZMQ to _not_ hang on exit.  So either something is broken, or someone needs to clue me in to what I'm doing wrong.\n\nHere's my versions on OS X:\n\n```\nPython 3.4.0 (default, Mar 27 2014, 11:16:52)\n[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.38)] on darwin\n>>> zmq.zmq_version()\n'4.0.4'\n>>> zmq.pyzmq_version()\n'14.1.1'\n```\n\nHere's my versions on CentOS 6.5:\n\n```\nPython 3.4.0 (default, Apr  8 2014, 14:10:50)\n[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux\n>>> zmq.zmq_version()\n'4.0.4'\n>>> zmq.pyzmq_version()\n'14.1.1'\n```\n\nHere are my examples of hanging (never exiting the python process).  The behavior is identical on both of my OS's, so I'll just post each example once.  I initially discovered this behavior in the small file I was making, but these interactive examples duplicate the behavior.\n\nREQ socket, linger on socket before connect:\n\n```\n>>> import zmq\n>>> c = zmq.Context()\n>>> s = c.socket(zmq.REQ)\n>>> s.setsockopt(zmq.LINGER, 0)\n>>> s.connect('tcp://localhost:3333')\n>>> s.send(b'')\n>>> ^D\n(hangs forever)\n```\n\nDoing the linger after the connect doesn't make a difference:\n\n```\n>>> import zmq\n>>> c = zmq.Context()\n>>> s = c.socket(zmq.REQ)\n>>> s.connect('tcp://localhost:3333')\n>>> s.setsockopt(zmq.LINGER, 0)\n>>> s.send(b'')\n>>> ^D\n(hangs forever)\n```\n\nDoing bind instead of connect doesn't make a difference:\n\n```\n>>> import zmq\n>>> c = zmq.Context()\n>>> s = c.socket(zmq.REQ)\n>>> s.setsockopt(zmq.LINGER, 0)\n>>> s.bind('tcp://0.0.0.0:3333')\n>>> s.send(b'')\n>>> ^D\n(hangs forever)\n```\n\nDoing the linger on the context doesn't make a difference:\n\n```\n>>> import zmq\n>>> c = zmq.Context()\n>>> c.setsockopt(zmq.LINGER, 0)\n>>> s = c.socket(zmq.REQ)\n>>> s.connect('tcp://localhost:3333')\n>>> s.send(b'')\n>>> ^D\n(hangs forever)\n```\n\nChanging the socket type doesn't make a difference:\n\n```\n>>> import zmq\n>>> c = zmq.Context()\n>>> s = c.socket(zmq.PUB)\n>>> s.setsockopt(zmq.LINGER, 0)\n>>> s.connect('tcp://localhost:3333')\n>>> s.send(b'')\n>>> ^D\n(hangs forever)\n```\n\nAnd lastly, changing the URL method doesn't make a difference:\n\n```\n>>> import zmq\n>>> c = zmq.Context()\n>>> s = c.socket(zmq.REQ)\n>>> s.setsockopt(zmq.LINGER, 0)\n>>> s.connect('ipc:///tmp/somefile')\n>>> s.send(b'')\n>>> ^D\n(hangs forever)\n```\n\n**Help!**\n"},"comment":{"url":"https://api.github.com/repos/zeromq/pyzmq/issues/comments/259447188","html_url":"https://github.com/zeromq/pyzmq/issues/537#issuecomment-259447188","issue_url":"https://api.github.com/repos/zeromq/pyzmq/issues/537","id":259447188,"user":{"login":"enkore","id":1330164,"avatar_url":"https://avatars.githubusercontent.com/u/1330164?v=3","gravatar_id":"","url":"https://api.github.com/users/enkore","html_url":"https://github.com/enkore","followers_url":"https://api.github.com/users/enkore/followers","following_url":"https://api.github.com/users/enkore/following{/other_user}","gists_url":"https://api.github.com/users/enkore/gists{/gist_id}","starred_url":"https://api.github.com/users/enkore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enkore/subscriptions","organizations_url":"https://api.github.com/users/enkore/orgs","repos_url":"https://api.github.com/users/enkore/repos","events_url":"https://api.github.com/users/enkore/events{/privacy}","received_events_url":"https://api.github.com/users/enkore/received_events","type":"User","site_admin":false},"created_at":"2016-11-09T15:49:34Z","updated_at":"2016-11-09T15:49:34Z","body":"FTR I've seen this bug with pyzmq 16.0.0 on Python 3.5.2. Or at least I think this is the bug. GDB trace from a hung process:\r\n\r\n```\r\n  Thread 1 (Thread 0x7f79293d2400 (LWP 5620)):\r\n  #0  0x00007f792885c48d in poll () from /usr/lib/libc.so.6\r\n  #1  0x00007f792020050a in zmq::signaler_t::wait (this=this@entry=0x1999e68, timeout_=timeout_@entry=-1) at src/signaler.cpp:218\r\n  #2  0x00007f79201ec240 in zmq::mailbox_t::recv (this=this@entry=0x1999e08, cmd_=cmd_@entry=0x7ffd1666dc30, timeout_=timeout_@entry=-1) at src/mailbox.cpp:80\r\n> #3  0x00007f79201dd8bc in zmq::ctx_t::terminate (this=0x1999d70) at src/ctx.cpp:165\r\n> #4  0x00007f791f400c38 in __pyx_f_3zmq_7backend_6cython_7context_7Context__term (__pyx_v_self=0x7f7921698358) at zmq/backend/cython/context.c:1954\r\n  #5  __pyx_pf_3zmq_7backend_6cython_7context_7Context_6term (__pyx_v_self=0x7f7921698358) at zmq/backend/cython/context.c:2066\r\n  #6  __pyx_pw_3zmq_7backend_6cython_7context_7Context_7term (__pyx_v_self=0x7f7921698358, unused=<optimized out>) at zmq/backend/cython/context.c:2032\r\n  #7  0x00007f7928e5f1bc in PyEval_EvalFrameEx () from /usr/lib/libpython3.5m.so.1.0\r\n  #8  0x00007f7928e602c3 in ?? () from /usr/lib/libpython3.5m.so.1.0\r\n  #9  0x00007f7928e603a3 in PyEval_EvalCodeEx () from /usr/lib/libpython3.5m.so.1.0\r\n  #10 0x00007f7928dcb008 in ?? () from /usr/lib/libpython3.5m.so.1.0\r\n  #11 0x00007f7928da02d7 in PyObject_Call () from /usr/lib/libpython3.5m.so.1.0\r\n  #12 0x00007f7928db6d44 in ?? () from /usr/lib/libpython3.5m.so.1.0\r\n  #13 0x00007f7928da02d7 in PyObject_Call () from /usr/lib/libpython3.5m.so.1.0\r\n  #14 0x00007f7928e56a87 in PyEval_CallObjectWithKeywords () from /usr/lib/libpython3.5m.so.1.0\r\n  #15 0x00007f7928dfd31d in ?? () from /usr/lib/libpython3.5m.so.1.0\r\n  #16 0x00007f7928e9923f in ?? () from /usr/lib/libpython3.5m.so.1.0\r\n> #17 0x00007f7928e9a071 in _PyGC_CollectNoFail () from /usr/lib/libpython3.5m.so.1.0\r\n> #18 0x00007f7928e723c8 in PyImport_Cleanup () from /usr/lib/libpython3.5m.so.1.0\r\n> #19 0x00007f7928e7cbb4 in Py_Finalize () from /usr/lib/libpython3.5m.so.1.0\r\n  #20 0x00007f7928e7d868 in Py_Exit () from /usr/lib/libpython3.5m.so.1.0\r\n  #21 0x00007f7928e805a8 in ?? () from /usr/lib/libpython3.5m.so.1.0\r\n  #22 0x00007f7928e8098d in PyErr_PrintEx () from /usr/lib/libpython3.5m.so.1.0\r\n  #23 0x00007f7928e81da5 in PyRun_SimpleFileExFlags () from /usr/lib/libpython3.5m.so.1.0\r\n  #24 0x00007f7928e9869c in Py_Main () from /usr/lib/libpython3.5m.so.1.0\r\n  #25 0x0000000000400af0 in main ()\r\n```"}}
{"actor":{"display_login":"enkore"}}