aws/aws-iot-device-sdk-python-v2

RuntimeError (AWS_ERROR_PRIORITY_QUEUE_EMPTY) occurs after 245 connection calls to greengrasscoreipc.connect()

shomerj opened this issue · 7 comments

Describe the bug

Python 3.9, arm32v7, Ubuntu buster

Not sure if this is a bug or explicitly built into the code.
Our system has been receiving RuntimeError after 245 calls when connecting to awsiot.greengrasscoreipc.connect(). The specific error message is RuntimeError: 30 (AWS_ERROR_PRIORITY_QUEUE_EMPTY): Attempt to pop an item from an empty queue.

Expected Behavior

Expected connection call to continue to working

Current Behavior

After the 245th established connection RuntimeError (AWS_ERROR_PRIORITY_QUEUE_EMPTY) is raised.

Reproduction Steps

This code snippet has reproduced the error:

import awsiot.greengrasscoreipc

count = 0
while True:
    ipc_client = awsiot.greengrasscoreipc.connect()
    print(f"Number of loops: {count}")
    count += 1

This was also tested with sleep added after each call.
Screenshot 2023-10-03 at 4 54 41 PM

Possible Solution

No response

Additional Information/Context

No response

SDK version used

1.12.6

Environment details (OS name and version, etc.)

Debian GNU/Linux, Debian 10 (buster)

Hi @shomerj,

It is hard to say what cause the issue by the error message here. Would you like to provide more logs? Please make sure to remove anything credential information in the log.
You can enable the logs by:

io.init_logging(io.LogLevel.Debug, `<out file>`)

Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.

The Greengrass IPC client bindings intentionally contain a reference cycle. You must call .close() on the client to break the cycle and put the client in a state where it can be GCd.

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

I'll see if there are some places in the documentation where it would make sense to add this information.

Closing as of #572

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.