Why does Greengrass IPC create so many open file descriptors?

0

I am using Greengrass IPC for components to communicate. I fire off a message every 5 seconds. However, it seems that this begins to fail with the error: RuntimeError: 45 (AWS_ERROR_MAX_FDS_EXCEEDED): The maximum number of fds has been exceeded..

I notice that before I start my component and I run the command lsof | wc -l, it shows about 41030 open file descriptors. But when I start my component, the number steadily climbs until it exceeds 1048576 which is the number I found by running the command ulimit -n It only takes a few minutes before it reaches the maximum number and produces that error.

Is there a leak or something in the IPC client?

profile picture
asked 8 months ago192 views
1 Answer
2
Accepted Answer

Hi Ken,

It sounds like you're maybe creating a new client to handle each publish request, is that right? You should only create one IPC client and then keep using that client for all requests. See the best practices here: https://docs.aws.amazon.com/greengrass/v2/developerguide/interprocess-communication.html#ipc-best-practices.

AWS
EXPERT
answered 8 months ago
profile pictureAWS
EXPERT
Greg_B
reviewed 8 months ago
profile pictureAWS
EXPERT
reviewed 8 months ago
  • Ugh.. that's EXACTLY what was happening. Thanks for the tip!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions