openhab / openhabian

openHABian - empowering the smart home, for Raspberry Pi and Debian systems
https://community.openhab.org/t/13379
ISC License
818 stars 251 forks source link

Startup loop #1870

Open mstormi opened 1 month ago

mstormi commented 1 month ago

At times, after updating the openHAB package, startup is stuck in a loop, spitting lots of java component errors. I came to think if we can supervise startup, detect and break these loops ? Unsure how, though.

Maybe if detected, pkill -9 java maybe add that to the update script option ? Add openhab-cli clean-cache, too ? (I think it's done on package install so may not help to do again but not 100% sure) Or add a systemd timer to do a regular health check maybe ? Note that can be a dangerous sword should it mistakenly detect OH to be down. It should only be active for say some hours after openhab service startup time.

BClark09 commented 1 month ago

I've not had this myself, but I have seen many talk about this issue. Is the openHAB process restarting (i.e. Karaf) or is the loop happening within openHAB's functions. If the former, then we can do a lot if an exit code is issued.

Add openhab-cli clean-cache, too ? (I think it's done on package install so may not help to do again but not 100% sure)

It is done on package install or on update..

Or add a systemd timer to do a regular health check maybe ?

There are things we can test by polling the activeness of core bundles: https://github.com/openhab/openhab-linuxpkg/issues/138

I came to think if we can supervise startup, detect and break these loops ?

I've been wondering if it's related to the amount of time that openHAB takes to shut down or restart. If it takes more than 120 seconds, then the openHAB service is killed with a SIGTERM, and I wonder if this has any effect on the quality of the update.

mstormi commented 1 month ago

Is the openHAB process restarting (i.e. Karaf) or is the loop happening within openHAB's functions. If the former, then we can do a lot if an exit code is issued.

No, it's within openHAB. Lots of Java exceptions.

ecdye commented 1 month ago

So are we just trying to add a temporary fix on the openHABian side until the underlying bug can be corrected with openHAB and its Java process?

mstormi commented 1 month ago

yeah, although AFAIK there's no such bug filed with openHAB

miloit commented 1 month ago

I have never seen this, but if you have @mstormi than file an issue so that they girls and boys aware of it