You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BLE: close() can self-join the event-loop thread on disconnect #968
On an unsolicited disconnect, bleak calls the disconnect callback (set to self.close()) on its own event-loop thread. close() then calls self._eventThread.join(...), i.e. joining the current thread, which raises RuntimeError: cannot join current thread, so cleanup doesn't finish (self.client is left set and _disconnected() never runs).
Pre-existing and separate from the hang fix in #967. A fix probably needs close()/disconnect() to notice when they're running on the event-loop thread and avoid joining/blocking it.
Seen on Linux, Python 3.14, bleak 2.1.1, RAK4631 (platform-independent).
Activity
max-arnold commentedon Aug 26, 2026
See #921 for another approach (patch included)