Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Leak of active DBus connections #91

@JoeHut

Description

@JoeHut
  • bleak version: master
  • Python version: 3.7.3
  • Operating System: Linux
  • Bluez version: 5.50

Description

DBus connections are not cleaned up after usage. Multiple calls to discover() result eventually in following error:

Traceback (most recent call last):
  File "discover.py", line 29, in <module>
    loop.run_until_complete(run())
  File "/usr/lib64/python3.7/asyncio/base_events.py", line 584, in run_until_complete
    return future.result()
  File "discover.py", line 22, in run
    devices = await discover(timeout=1)
  File "/home/joe/code/proglove/python/bleak/bleak/backends/bluezdbus/discovery.py", line 125, in discover
    bus = await client.connect(reactor, "system").asFuture(loop)
txdbus.error.RemoteError: org.freedesktop.DBus.Error.LimitsExceeded: The maximum number of active connections for UID 1000 has been reached

For me this happens at the 246th call to discover()

Metadata

Metadata

Assignees

Labels

Backend: BlueZIssues and PRs relating to the BlueZ backendbugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions