-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Hello, and thanks for this useful repo.
I am currently having a problem and a hard time figuring out its source. I've dwelved in the Tmds.Dbus codebase as well as this libraries' to no avail.
I am using a Pi4 as a gateway to periodically scan for specific devices in its vicinity. Eventually however, my service crashes with the error message:
dbus-daemon[489]: [system] Connection ":1.37" is not allowed to add more match rules (increase limits in configuration file if required; max_match_rules_per_connection=2048)
There might be a couple hundred devices around me, with no new devices coming and going.
method call time=1704712160.531241 sender=:1.37 -> destination=org.freedesktop.DBus serial=278 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
string "type='signal',interface='org.freedesktop.DBus.Properties',member='PropertiesChanged',path='/org/bluez/hci0/dev_3A_A9_CC_B9_8F_37'"
I have logged the first three scans, with the following results:
- On my first couple of scans, I can see the AddMatch messages piling up, reduced at each 15s scan as all devices get eventually seen by the gateway.
- At each new scan, I can see the InterfacesAdded messages piling up with each device being added.
- At the end of each scan, I can see an equal amount of InterfacesRemoved messages piling up with each device being removed.
But after a couple of days, I get the crash with the aforementionned error message of max_match_rules_per_connection exceeded.
I'm suspecting there might be some sort of AddMatch leak somewhere...
Perhaps my devices eventually get a new name, somehow, and are given a new match rule ?
A simple workaround is to reboot the service automatically at each crash, but I'd be interested in finding an elegant solution to be able to RemoveMatch. Do you think this might be a problem in the library, or am I lost in bluetooth translation ?
Thank you greatly for any insight, and I remain at your disposal for any further information.