IanHarvey / bluepy

Python interface to Bluetooth LE on Linux
Other
1.6k stars 490 forks source link

Bluepy_helper 100% CPU infinite loop on failed write with response #332

Closed DylanSale closed 3 years ago

DylanSale commented 5 years ago

Using: bluepy 1.2.0 on ubuntu 18.04 with a UD100 in docker.

Problem: I discovered that when no response is returned from a write withResponse=True call on a characteristic, btmon shows that the connection is eventually closed, but bluepy_helper keeps calling poll with a closed file descriptor at 100% CPU, seemingly in an infinite loop.

Solution: The helper process has to be killed manually (or via a watcher daemon)

I think this is a bug in bluepy_helper - if the connection is closed on a failed write with response, the helper should exit and an error should be returned to the bluepy code, rather than seemingly retrying forever.

Originally posted by @DylanSale in https://github.com/IanHarvey/bluepy/issues/239#issuecomment-443102778

nemccarthy commented 4 years ago

Any updates on this one. Seeing same behaviour with Home assistant and rpi 4

z0ph commented 4 years ago

Same issue here. Any update?

michapr commented 4 years ago

Same here - any idea how to solve it?

Thanks!