Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS SDK Secure Tunneling causing an individual core to persistently stay at 100% #598

Closed
1 task
JosepTeruel opened this issue Dec 2, 2024 · 2 comments
Closed
1 task
Labels
bug This issue is a bug. closed-for-staleness p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days.

Comments

@JosepTeruel
Copy link

Describe the bug

As referenced on this issue (#596). We have made some changes to our code to start using the v2 SDK and to eliminate the unnecessary infinite loop. However, we are still experiencing 100% CPU usage on one core.

You mentioned that we might consider using Greengrass, but since we don’t require offline communication between IPCs, we are currently using AWS IoT Core Things.

Are there specific scenarios where Greengrass could provide better advantages? Our primary focus is ensuring secure tunneling within our IPC setup.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

CPU usage is very low

Current Behavior

CPU usage is at 100%

Reproduction Steps

We run the attached script as a service within the IPC which is based on AWS documentation.

secure_tunneling.txt

Possible Solution

No response

Additional Information/Context

No response

SDK version used

1.5.4

Environment details (OS name and version, etc.)

Ubuntu 22.04

@JosepTeruel JosepTeruel added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 2, 2024
@jmklix
Copy link
Member

jmklix commented Dec 2, 2024

It looks like you are still running into the same problem. In your code you have this while loop:

while True:
    output = process.stdout.readline()
    if output == b'' and process.poll() is not None:
        break
    if output:
        output_str = output.decode('utf-8').strip()
        if "[error]" in output_str:
            logger.error("Error detected, stopping process.")
            process.terminate()
            break

Your program will still run in a continuous loop in some cases. That is likely the cause of the 100% cpu usage. Take a look at this stack overflow answer on possible solutions: https://stackoverflow.com/a/28010179

@jmklix jmklix added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days. p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Dec 2, 2024
Copy link

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.

@github-actions github-actions bot added closing-soon This issue will automatically close in 5 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 5 days unless further comments are made. labels Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closed-for-staleness p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 2 days.
Projects
None yet
Development

No branches or pull requests

2 participants