seifert / ipcqueue Goto Github PK
View Code? Open in Web Editor NEWPOSIX and SYS V messages queues implementation for Python
License: BSD 3-Clause "New" or "Revised" License
POSIX and SYS V messages queues implementation for Python
License: BSD 3-Clause "New" or "Revised" License
Hi,
We're getting the QueueError "no system resources" error meaning the mqueue does not exist. We implemented a 12FA retry loop, and ended up running out of filehandles. Checking via /proc/PID/fd
on Linux shows these filehandles are to blame:
lrwx------ 1 root root 64 Aug 4 23:47 994 -> /BarToFoo
lrwx------ 1 root root 64 Aug 4 23:47 995 -> /FooToBar
lrwx------ 1 root root 64 Aug 4 23:47 996 -> /BarToFoo
lrwx------ 1 root root 64 Aug 4 23:47 997 -> /FooToBar
lrwx------ 1 root root 64 Aug 4 23:47 998 -> /BarToFoo
lrwx------ 1 root root 64 Aug 4 23:47 999 -> /FooToBar
Between retries, we're not saving objects with the handles in them anywhere that would prevent the gc from releasing them. They're being created via posixmq.Queue("/FooToBar", serializer=...)
and saved only as a private attribute of a class, ~2-4 functions calls deep from the exception handler that implements the retry loop. I wouldn't say I'm 100% certain but I know from having maintained a similar module that leaks are 99% of the maintenance of a dynamic language to C library binding module. Platform is linux/arm64hf.
Thanks for writing ipcqueue
!
This error message is highly confusing when dealing with two services communicating over posixmq
. As IPC message queues have various tunables for things like the queue size, message size, and there as global system limits that specify the maximum amount of memory that may be allocated to posixmq at any one time, you might end up thinking you got it wrong and keep increasing the queue size or system limits. However the problem is simply that the other process is not running, or has a typo in their MQ name or something. And then this is bad because too much buffering in general can lead to processing delays and lag in your "realtime" channel, especially with python as a consumer
For the specific case where the mqueue does not exist, the error should be closer to "No such file or directory" or "Message Queue has not been created" (for read-only queues)
It'd be useful to be able to register a Python callback for when new messages are received either using a signal or a thread.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.