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

Blocking call scheduled on loop when closing connection #81

Closed
mvn23 opened this issue Mar 2, 2022 · 1 comment · Fixed by #82 or zigpy/zigpy-deconz#190
Closed

Blocking call scheduled on loop when closing connection #81

mvn23 opened this issue Mar 2, 2022 · 1 comment · Fixed by #82 or zigpy/zigpy-deconz#190

Comments

@mvn23
Copy link

mvn23 commented Mar 2, 2022

When the serial connection is closed or lost, _call_connection_lost() is scheduled on the loop from _abort() or _close(). From there, _serial.close() is called here:

self._serial.close()

Unfortunately, _serial.close() calls time.sleep(0.3) in certain cases (e.g. here), which blocks the entire loop for its duration.

See also: home-assistant/core#67430 where the problem was first mentioned.

@elupus
Copy link
Contributor

elupus commented Mar 29, 2022

Should be enough to run close, and probably open in an asyncio executor.

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