Code Monkey home page Code Monkey logo

ipcqueue's People

Contributors

pragus avatar seifert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ipcqueue's Issues

Filehandle leak on failure to open an MQ

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!

QueueError "no system resources" error raised when mqueue does not exist

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.