Comments (6)
Got this problem for a while and found that recv function throws out exception "Not Enough Space"
from libzmq.
Two separate things:
- It should not crash (there is a bug)
- If you are using pub-sub over TCP that is not the best way to multicast a file (as blocks are sent individually to every subscriber)
You should post more info, make a build with symbols/debug info, post the call stack with details so the issue can be tracked down and fixed.
Separately, given the information you supplied, you should consider actual multicasting (using NORM or PGM, or even UDP (RADIO/DISH)) - depending on your circumstances - to effectively multicast the data (sent it once to the wire to any number of subscribers) versus of sending it N times in 1:1 pipes where N is the number of subscribers.
from libzmq.
After trying I have to nuance the above perspective: I tried with PGM and there are rate limits coming into play for multicasting that may make it impractical for your case.
The good thing is all recipients gets the data at once, yet depending on the number of recipients it might be quicker to use PUB-SUB over TCP and send the data N times without rate throttling, or sent it only once (to all recipients at once) but more slowly and without saturating the network with PGM. There is a point where PGM will start to win as the transfer time does not strongly depend on the number of recipients.
I didn’t try NORM but that protocol was designed for large file distribution to many clients so it might be more suited than round-robin TCP PUB-SUB or rate-limited PGM.
Besides that I tried PUB-SUB over TCP (local host) with a few recipients and up to 1GB sent 16x to each recipient and did not see a crash.
from libzmq.
Hi @axelriet thanks for you response.
I have tried pgm (open-pgm) only and the server is in Java and the receiver is in C++.
The issue happens randomly, as a default recovery mechanism, when the receiver couldn't receive the packets (some issue) I try to reconnect the socket after some retries (when the recv() call return EAGAIN), say 10 times with a timeout of 10 seconds, that too after a few cycles of the recovery process. Also the rate limiting, highwatermark, receive buffer options are set in both client and server.
I couldn't predict the behavior as this happens when multicasting on a single machine and multiple machines. Also the phase it gets crashed is not same every time.
Attached below are the exception and the call stack. Kindly share your insights.
One thing I could see is, when the program about to crash, the whole OS is stuck, I try to go to taskmgr to check the resources, but I couldn't.
Also, regarding the norm protocol, I haven't tried yet. Will check.
from libzmq.
From the screenshot it looks like an assertion fails at line 464 after trying to allocate 1MB:
Line 464 in 959a133
I'm not sure why this large buffer is needed but, regardless, everything indicates a RAM exhaustion on the machine. Probably a rapid leak.
Since you are on Windows you could enable heap debugging in your process, specifically _CRTDBG_LEAK_CHECK_DF. See https://learn.microsoft.com/en-us/cpp/c-runtime-library/crt-debug-heap-details?view=msvc-170 for details. You call _CrtSetDbgFlag() at the very start of your program: https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/crtsetdbgflag?view=msvc-170
Make sure you exit gracefully before the machine runs completely out and you should be able to track down what leaked.
Another option is to use Intel Inspector (it's a free download that integrates with Visual Studio) to try and see what leaks and where the memory was allocated: https://www.intel.com/content/www/us/en/developer/tools/oneapi/inspector.html Get the standalone version. You may need to register to get access.
I have reservations about NORM. The protocol and the library seems fine but I'm less sure about the integration in zmq. Let us know if it works for you.
from libzmq.
@axelriet Thanks for your Input, Will check with the tools if probable, Since I am running the application on WinPE environment, not sure I could use the tools provided at all.
Also, I'm open for all the options available. Kindly check for the possibility of using norm with ZMQ or any way possible.
Kindly share the code which you have tested (Multicast using PGM) if possible, helps me to correct If I did something wrong. (The problem arises only during the transfer of large data over PGM Multicast with machines with lower RAM size say 4GB).
from libzmq.
Related Issues (20)
- Using non-ASCII characters in Unix domain socket paths doesn't work on Windows platform
- Assertion failed: pfd.revents & POLLIN (/zmq/build/libzmq-src/src/signaler.cpp:265) HOT 5
- How to achieve self-repair, instead of crashing, when the loopback connection within zmq::signaler_t is interrupted in a Windows environment? HOT 1
- Assert in `zmq::object_t::process_command` (src/object.cpp:170)
- ZMQ_ROUTER Semantics: Dropping Disconnected Peers
- Has vulnerability "CVE-2020-36400" been fixed? HOT 3
- Is there a definitive list of security vulnerabilities against libzmq versions? HOT 2
- Platform.hpp not found issue on macOS Sonoma and Xcode 15.2 HOT 1
- NPM install failed for zeromq dependency while installing device farmer STF. NPM logs available in the description. HOT 1
- ZMQ subscriber doesn't receive message first time occasionally. HOT 2
- What is the procedure to finalise a DRAFT API feature HOT 1
- BUG: IPC socket drops messages, ignores LINGER HOT 1
- How can I clear the internal buffer of ZMQ multicast without closing the socket?
- Add more guidance on error handling in the guide/docs
- Too many resets on loopback after socket.connect() call HOT 1
- cmake: ZMQ_WIN32_WINNT autodetection broken when cross-compiling with mingw-w64
- When the topic length of sub exceeds 15kb, xpub crashes when calling zmq_msg_recv.
- High latency when messages are not being send repeatedly HOT 4
- Latest libsodium has deprecated functions, causing it not to compile HOT 1
- tools: curve_keygen not built when building with cmake, ninja HOT 2
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 libzmq.