Comments (4)
Using gdb, I found what is blocking after my code has finished.
(gdb) bt
#0 0x00007ffff71d712d in poll () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007ffff3700a6a in ?? () from /usr/lib/x86_64-linux-gnu/libzmq.so.3
#2 0x00007ffff36ed2f7 in ?? () from /usr/lib/x86_64-linux-gnu/libzmq.so.3
#3 0x00007ffff36e463c in ?? () from /usr/lib/x86_64-linux-gnu/libzmq.so.3
#4 0x00007ffff3715388 in zmq_ctx_term () from /usr/lib/x86_64-linux-gnu/libzmq.so.3
#5 0x00007ffff294c7e9 in __pyx_f_3zmq_7backend_6cython_7context_7Context__term (__pyx_v_self=0x7ffff24b5f28) at zmq/backend/cython/context.c:1773
#6 __pyx_pf_3zmq_7backend_6cython_7context_7Context_4__dealloc__ (__pyx_v_self=0x7ffff24b5f28) at zmq/backend/cython/context.c:1391
#7 __pyx_pw_3zmq_7backend_6cython_7context_7Context_5__dealloc__ (__pyx_v_self=0x7ffff24b5f28) at zmq/backend/cython/context.c:1323
#8 __pyx_tp_dealloc_3zmq_7backend_6cython_7context_Context (o=0x7ffff24b5f28) at zmq/backend/cython/context.c:3093
#9 0x0000000000487176 in subtype_dealloc (self=0x7ffff24b5f28) at Objects/typeobject.c:1226
#10 0x000000000046914f in free_keys_object (keys=0xc0f5f0) at Objects/dictobject.c:354
#11 PyDict_Clear (op=<optimized out>) at Objects/dictobject.c:1323
#12 0x000000000046b532 in PyDict_Clear (op=<optimized out>) at Objects/dictobject.c:1301
#13 0x000000000048b9d8 in type_clear (type=0xc0b638) at Objects/typeobject.c:3282
#14 0x0000000000542992 in delete_garbage (old=<optimized out>, collectable=<optimized out>) at Modules/gcmodule.c:866
#15 collect (generation=generation@entry=2, n_collected=n_collected@entry=0x0, n_uncollectable=n_uncollectable@entry=0x0, nofail=nofail@entry=1) at Modules/gcmodule.c:1014
#16 0x00000000005435b1 in _PyGC_CollectNoFail () at Modules/gcmodule.c:1605
#17 0x000000000050e33c in PyImport_Cleanup () at Python/import.c:481
#18 0x0000000000521de9 in Py_Finalize () at Python/pylifecycle.c:576
#19 0x0000000000521fb5 in Py_Finalize () at Python/pylifecycle.c:524
#20 0x00000000004204d7 in Py_Main (argc=argc@entry=2, argv=argv@entry=0x8ee010) at Modules/main.c:788
#21 0x000000000041c3b7 in main (argc=2, argv=<optimized out>) at ./Programs/python.c:69
from aiozmq.
Hmm. Looks interesting.
Do you have hang on zmq context termination stage?
Not sure what can I change in aiozmq but you may try zmq.Context.instance().term()
after loop.close()
call.
from aiozmq.
Oh, I just googled a bit and experimented another bit, and found that setting LINGER option resolves this problem.
e.g., Insertsock.transport.setsockopt(zmq.LINGER, 50)
just after the create_zmq_stream()
call.
It seems that the underlying TCP connection was not established (because I'm using a wrong address intentionally) and the followed write call makes the termination process of libzmq to poll availability of the TCP connection internally.
from aiozmq.
Therefore, this is not the "fault" of aiozmq at all; I'm closing the issue. :)
from aiozmq.
Related Issues (20)
- Allow custom packer for rpc HOT 1
- it seems that readme file needs updating HOT 1
- update docs link in the project description HOT 1
- Receiver end stops receiving
- zmq_events_test.py:ZmqLooplessTests.test_req_rep hangs
- example of aiozmq.rpc with PyQt5
- Process hangs with 100% CPU after several weeks uptime HOT 2
- why the Publish-Subscribe can't run?
- Switch CI to GitHub Actions
- Prepare 1.0 release HOT 6
- Support Python 3.10 HOT 4
- Interest in man pages? HOT 2
- asyncio.CancelledError should be caught in "try_log" HOT 1
- Python 3.10: wait_for() got an unexpected keyword argument 'loop' HOT 1
- New release for python 3.11 HOT 2
- Can't run tests on python 3.11 HOT 2
- Project's README is misleading about pyzmq.
- Strange behaviour (or me not properly understanding asyncio and aiozmq) - Code only sends when publish more than once HOT 1
- ROUTER-ROUTER can't send msg HOT 1
- How to flush a transmit buffer?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aiozmq.