-
Notifications
You must be signed in to change notification settings - Fork 22
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
Strange behavior on ravel connection object deletion #50
Comments
Yeah, I can confirm that the Ravel code is currently a bit mixed up in its signal handling. There are two mechanisms for implementing signal listeners: one as part of registering an interface class ( |
Thank you for your quick response; I will follow this issue. |
OK, I have changed the code to correctly scan for signal listeners in both places, and only check for registered interfaces for server-side listeners. See if it works better now. |
Hi, thank you this is much better on this side, there is no stacktrace anymore. However an explicit call to The current mandatory tear down of the code fragment shown above is therefore (I know that many things can happen between initialization and teardown :s):
|
I don’t run Kodi, so I won’t be able to replicate that part of the behaviour. Note that the objects returned by Also note that you have to explicitly attach a And I see you run the event loop on a separate thread. While libdbus was originally meant to support multithreading, nevertheless there are some gotchas and bugs that I think they have basically declared unfixable... |
Yes the ravel connection is attached to the asyncio loop:
I'll take your word for it :p Especially since I have another example of a module which does not use threading/asyncio and which does not have the Thanks for your help, I think we can close this issue. |
Hi, I meet a strange behavior in a kodi plugin using Ravel to handle Bluetooth devices.
The issues that expose the problem and partially resolve it are here:
LibreELEC/LibreELEC.tv#5645
LibreELEC/service.libreelec.settings#245
Basically the code using Ravel is present here:
https://github.com/LibreELEC/service.libreelec.settings/blob/8b1efa30632dd4b5c0493cfab2cc940a927392de/resources/lib/dbus_utils.py#L119-L122
Abbreviated example (it seems to follow your recommendations?):
Calling
LOOP_THREAD.stop()
is ok but Kodi crashes just after for some reason.The dbus connection object obtained through Ravel does not seem to be deleted correctly, even if it is explicitly requested with del.
It ends with the following stacktrace after an explicit
del BUS
:Only a garbage collection solves the problem on the Kodi side.
I am not the developer of this code but I found the way to prevent crash. It is difficult for me to know if it is on the side of dbussy or on the side of the Python code developed on the project.
On the project side it seems to be difficult to know where is the implementation error regarding the dbussy base code.
I am aware that it will also be difficult for you to audit this code base.
However, maybe you can give a hint on what could go wrong and generate the error in Ravel?
Thanks for reading.
The text was updated successfully, but these errors were encountered: