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

Consuming 100% CPU #195

Closed
dlarrick opened this issue Feb 22, 2020 · 4 comments
Closed

Consuming 100% CPU #195

dlarrick opened this issue Feb 22, 2020 · 4 comments

Comments

@dlarrick
Copy link

Greetings,

Since 0.70 upgrade, insteon-mqtt is working fine for me but consuming 100% of one core on my system.

It's looping continuously in the main network event loop. If I add a time.sleep(0.05) at the end of the loop at the bottom of start.py the problem goes away, but I am not at all clear that this is a correct fix or just a bandaid hiding the real problem.

@TD22057
Copy link
Owner

TD22057 commented Feb 22, 2020

@krkeegan

There was a new construct introduced to help w/ scene syncing that interfaces with the network event loop. I'm guessing it's something to do with that. I'll take a look later today and get it fixed ASAP.

@TD22057
Copy link
Owner

TD22057 commented Feb 23, 2020

Diagnosis: the new stack class uses a temporary file to get a fileno because that's what the network select code requires. But that means the file is always available to read from so the event loop keeps trying to read. I think the fix is to change the network event loop to allow a None fileno and only poll the stack instead of triggering on read/write like a socket.

@dlarrick
Copy link
Author

Awesome, thanks for the quick turnaround!

@krkeegan
Copy link
Collaborator

Wow, nice fix. Sorry to have created such a bug. Somehow that didn't happen to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants