zeromq / netmq

A 100% native C# implementation of ZeroMQ for .NET
Other
2.95k stars 744 forks source link

The ROUTER socket can not receive the message after a while #860

Closed americaboy closed 2 years ago

americaboy commented 4 years ago

Environment

ZMQ Version:  4.3.2   libzmq
Operating System: Android 8.1

Expected behaviour

ROUTER socket can receive evey messages all the time in REQ-ROUTER-ROUTER-REQ pattern.

Actual behaviour

The ROUTER socket can not receive the message after a while

Steps to reproduce the behaviour

By using example code :lbbroker: Load balancing broker in C I want used REQ-ROUTER-ROUTER-REQ pattern to implement for IPC in my device. client: REQ server: ROUTER-ROUTER-REQ action: There is always no problem that client sends a request to the server every 20ms, and the server replies back to the client.

But if I adjust the sending interval to 10ms or less,the Router socket will block in zmq_poll().

americaboy commented 4 years ago

I find the reason seem is that create and destroy the socket constantly in client thread. so,I pre-create the socket avoid this issue. but the Server will be aborted at sometime by error: "Assertion failed: !_more (vendor/hht/external/libzmq/src/fq.cpp:112)."

What causes this problem to occur probabilistically? thx!

01:34:57.994 9020 9020 F DEBUG : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------

01:34:57.994 9020 9020 F DEBUG : x0 0000000000000000 x1 0000000000001dd3 x2 0000000000000006 x3 0000000000000008
01:34:57.994 9020 9020 F DEBUG : x4 5e1fff6f6f622d70 x5 5e1fff6f6f622d70 x6 5e1fff6f6f622d70 x7 7f7f7f7f7f7f7f7f
01:34:57.994 9020 9020 F DEBUG : x8 0000000000000083 x9 b9e45cf964dfd381 x10 0000000000000000 x11 ffffffffffffffff
01:34:57.995 9020 9020 F DEBUG : x12 000000782b3735e0 x13 0000000000000003 x14 0000000000000000 x15 0000000000000000
01:34:57.995 9020 9020 F DEBUG : x16 000000782b3912d8 x17 000000782b2ebacc x18 000000782b39c000 x19 0000000000001dce
01:34:57.995 9020 9020 F DEBUG : x20 0000000000001dd3 x21 0000000000000083 x22 000000782b4d00fd x23 000000782b4d03ee
01:34:57.995 9020 9020 F DEBUG : x24 000000782b4d03c8 x25 000000782b3939d8 x26 000000782a89c829 x27 000000782a89c829
01:34:57.995 9020 9020 F DEBUG : x28 0000000000000000 x29 000000782a89c580 x30 000000782b2e0fbc
01:34:57.995 9020 9020 F DEBUG : sp 000000782a89c540 pc 000000782b2e0fdc pstate 0000000060000000
01:34:58.058 9020 9020 F DEBUG :
01:34:58.058 9020 9020 F DEBUG : backtrace:
01:34:58.058 9020 9020 F DEBUG : #00 pc 000000000001dfdc /system/lib64/libc.so (abort+112)
01:34:58.059 9020 9020 F DEBUG : #01 pc 000000000004cb90 /vendor/lib64/libzmq.so (zmq::zmq_abort(char const)+8)
01:34:58.059 9020 9020 F DEBUG : #02 pc 000000000004cf44 /vendor/lib64/libzmq.so (zmq::fq_t::recvpipe(zmq::msg_t
, zmq::pipe_t*)+240)
01:34:58.059 9020 9020 F DEBUG : #03 pc 0000000000065304 /vendor/lib64/libzmq.so (zmq::router_t::xrecv(zmq::msg_t
)+108)
01:34:58.059 9020 9020 F DEBUG : #04 pc 000000000006db80 /vendor/lib64/libzmq.so (zmq::socket_base_t::recv(zmq::msg_t, int)+168)
01:34:58.059 9020 9020 F DEBUG : #05 pc 0000000000085fe4 /vendor/lib64/libzmq.so (zmq_recv+96)
01:34:58.059 9020 9020 F DEBUG : #06 pc 0000000000015cf0 /vendor/lib64/libmsp.so (MSPStub::zmq_recvmore(void
, std::1::basic_string<char, std::__1::char_traits, std::1::allocator>&, int)+692)
01:34:58.072 9020 9020 F DEBUG : #07 pc 0000000000012258 /vendor/lib64/libmsp.so (MSPStub::routerBrokerThread()+5112)
01:34:58.072 9020 9020 F DEBUG : #08 pc 000000000001f750 /vendor/lib64/libmsp.so (_ZNSt3114thread_proxyINS_5tupleIJNS_10unique_ptrINS_15__thread_structENS_14default_deleteIS3_EEEEM7MSPStubFvvEPS7EEEEEPvSC+64)

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had activity for 365 days. It will be closed if no further activity occurs within 56 days. Thank you for your contributions.