Skip to content
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

Work around deadlock when calling xbmc.executebuildin(Reboot) #211

Merged
merged 1 commit into from
Jan 25, 2021

Conversation

mglae
Copy link
Contributor

@mglae mglae commented Jan 5, 2021

Calling xbmc.executebuildin('Reboot') from Settings addon result in deadlock in libdbus python callback.

Use /usr/bin/systemctl --no-block reboot instead.

Backtrace: http://ix.io/2KYC Debug log: http://ix.io/2KYD

For the tests a minimal not functional version of the bluetooth.py module was used to avoid the typical hang on exit because of using dbus-python (deleting bluetooth.py is possible too).

Note: calling xbmc.executebuildin('Reboot') from an addon not using dbus i.e. script.hello.world.reboot-matrix.zip is still possible.

@thoradia
Copy link
Contributor

thoradia commented Jan 6, 2021

Why not calliing /usr/bin/systemctl --no-block reboot
Do however avoid referring to the oe.execute in particular or to the oe package in general, which will gradually be made obsolete
Instead use subprocess.check_output(command.split())

@mglae
Copy link
Contributor Author

mglae commented Jan 6, 2021

Why not calliing /usr/bin/systemctl --no-block reboot

That is exactly called. Or do I miss something?

Do however avoid referring to the oe.execute in particular or to the oe package in general, which will gradually be made obsolete

oe.execute() is the currently used function all over the code. If this is replaced in the future all appearances can be replaced by the then preferred call.

@flubshi
Copy link
Contributor

flubshi commented Jan 10, 2021

My Raspberry PI 4 usually won't restart using the LE Settings Addons manual update mechanism. I tested this PR as described here, using service.libreelec.settings_wo_bluetooth-9.80-20210105.zip.

This PR seems to fix the issue for me. All 4 of 4 update attempts with this LE Settings version worked flawless and the pi booted after image was downloaded.

Thanks @mglae !

@khaoohs
Copy link

khaoohs commented Jan 10, 2021

My Raspberry PI 4 usually won't restart using the LE Settings Addons manual update mechanism. I tested this PR as described here, using service.libreelec.settings_wo_bluetooth-9.80-20210105.zip.

This PR seems to fix the issue for me. All 4 of 4 update attempts with this LE Settings version worked flawless and the pi booted after image was downloaded.

Thanks @mglae !

Same for me with Intel x86.

@chewitt
Copy link
Member

chewitt commented Jan 14, 2021

@mglae is it possible to do this without the oe.execute dependency? then we're not adding to the work of removing it.

@mglae mglae force-pushed the le10_no_executebuildin_reboot branch from e7a82d8 to 5a63da8 Compare January 16, 2021 14:23
@mglae
Copy link
Contributor Author

mglae commented Jan 16, 2021

Done.

@flubshi
Copy link
Contributor

flubshi commented Jan 24, 2021

I tested the new version using subprocess.call instead of oe.execute from le10_no_executebuildin_reboo branch. This works reliable as well.
@chewitt is this going to be accepted?

@chewitt chewitt merged commit 0e4e1c5 into LibreELEC:master Jan 25, 2021
@mglae mglae deleted the le10_no_executebuildin_reboot branch January 25, 2021 18:31
@mglae
Copy link
Contributor Author

mglae commented Jan 25, 2021

To partial repeat comment 1: this is not sufficient to fix the hang on reboot. It still occur when using dbus-python in bluetooth.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants