openhab / openhab-core

Core framework of openHAB
https://www.openhab.org/
Eclipse Public License 2.0
912 stars 420 forks source link

'systemctl stop openhab' takes a long time and throws an exception #2073

Closed ronisaacson closed 1 year ago

ronisaacson commented 3 years ago

With openhab 3.0.0 on Fedora, installed from the yum repo and managed by systemd... every time I try and stop OH using systemctl stop openhab it logs this in the systemd journal:

Dec 17 00:41:28 xxx systemd[1]: Stopping openHAB - empowering the smart home...
Dec 17 00:41:33 xxx karaf[1204679]: org.osgi.framework.BundleException: Unable to acquire the state change lock for the module: osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.12.100.v20180210-1608"; singleton:="true" [id=0] STOPPED [STOPPED]
Dec 17 00:41:33 xxx karaf[1204679]:         at org.eclipse.osgi.container.Module.lockStateChange(Module.java:337)
Dec 17 00:41:33 xxx karaf[1204679]:         at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule.asyncStop(EquinoxBundle.java:156)
Dec 17 00:41:33 xxx karaf[1204679]:         at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle.stop(EquinoxBundle.java:262)
Dec 17 00:41:33 xxx karaf[1204679]:         at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle.stop(EquinoxBundle.java:267)
Dec 17 00:41:33 xxx karaf[1204679]:         at org.eclipse.osgi.launch.Equinox.stop(Equinox.java:123)
Dec 17 00:41:33 xxx karaf[1204679]:         at org.apache.karaf.main.Main$2.run(Main.java:354)
Dec 17 00:41:33 xxx karaf[1204679]: Caused by: java.util.concurrent.TimeoutException: Timeout after waiting 5 seconds to acquire the lock.
Dec 17 00:41:33 xxx karaf[1204679]:         at org.eclipse.osgi.container.Module.lockStateChange(Module.java:334)
Dec 17 00:41:33 xxx karaf[1204679]:         ... 5 more
Dec 17 00:41:43 xxx systemd[1]: openhab.service: Succeeded.
ronisaacson commented 3 years ago

One more thing: I found the (empty) file /var/lib/openhab/cache/org.eclipse.osgi/.manager/.fileTableLock, stopped OH and removed it. But it came right back upon restart. Also tried clearing the entire /var/lib/openhab/cache directory and letting OH rebuild it on the next restart, but same thing again.

J-N-K commented 2 years ago

Is this still the case with openHAB 3.2?

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.