-
-
Notifications
You must be signed in to change notification settings - Fork 428
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
Thing manager logic causes things to stuck in NOT_YET_READY #3823
Comments
This issue has been mentioned on openHAB Community. There might be relevant details there: |
@J-N-K : maybe it "talks" to you? |
I wonder why |
It's fine that the FolderObserver is not activated when the ModelParser is added. The ready marker is correctly added later After the FolderObserver is activated. We could run into issues when the FolderObserver is never activated. Is that the case in your setup? |
But have a look at the Can you check whether the items |
(l.205) Will only be executed if the openhab/conf/items folder is present. So, for openhab to launch correctly, the openhab/conf/items folder must be present. If it is not there, then the problems will be described above. My system does not have this folder, items are stored in the file openhab/userdata/jsondb/org.openhab.core.items.Item.json. After an empty folder has been created. All things changed the status from NOT_YET_READY to Online the next time openhab was launched. |
At my knowledge, this folder is there when you install OH. |
Just unzip the ZIP file of any release to verify. |
The folder is missing because it is running via docker-compose version: '3.9' openhab: |
This issue has been mentioned on openHAB Community. There might be relevant details there: |
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/openhab-4-3-milestone-discussion/158139/58 |
Hello, I was wondering about the state of this issue. Thanks, |
Do you have an empty conf directory (like @pashalaev)? |
No, on my side the conf directory is there. I've setup openhab core on the dev environement, and see the same behaviour. missing prerequisite map is populated, preventing the binding to start correctly. The OnReadyMarker is never called, so the prerequisite check thread is never started on my side (don't know why). Only if I setup the thing in a .thing file (not in the registry), it start working. Laurent. |
I don't see this issue. Can you provide a step-by-step was to reproduce it, starting with a fresh installation of latest Snapshot? |
Hum, strange. I was not able to reproduce it on clean last snapshot. Laurent |
There are apparently different reasons for this problem. I never encountered this issue in my production environment because I am using config files. But in dev environment (OH started from Eclipse), I can provide the sequence to reproduce the issue systematically: I am not sure since when this problem appeared in dev environment but we can no more use managed things in dev. We are many to encounter this issue. The current workaround is to not use managed things but only things declared in config files (like demo.things). |
In my production environment (RPI), I still use managed things for the Matter binding and I do not encounter this issue. |
I can also confirm the problem when running the "demo.app" from Eclipse. I'm working on a binding, and it's actually quite problematic at the moment, since when I'm forced to use file based Things, the configuration is read-only, so I can't test/debug configuration changes made from the UI. Another issue that I suspect is related is that even with file based Things, if I modify one of the XML files while "demo.app" is running, the change is correctly detected when I save them and something is reloaded - which leads to the same
|
Without knowing anything about the underlying problem, I can't help but think that making whatever fails more robust by making fewer assumptions would be much better than trying to "arrange the environment" to match the assumptions by for example creating files or folders. |
Config from a text file should not be modified. If you want dynamic configuration, use managed things. |
My point is that because of this issue, it's impossible to use managed things while developing - thus making debugging and testing of dynamic configuration impossible. |
Maybe the problem I'm having when running "demo.app" from Eclipse doesn't have the same cause - even though the symptoms are the same. I've imported "core" into Eclipse and after some hours of building been able to try out the changes in 681308d. This makes no difference whatsoever for the issue I'm experiencing. I'd like to add that my computer really is too slow to effectively work/debug in Eclipse when "core" is included, just a simple launch can easily take a couple of minutes. Building takes "forever". So, either you guys have some insane hardware, or build/run in a different way, because this isn't really usable. |
Hello, @Nadahar : I've take very long time last past 2 week to configure core inside my Eclipse setup. It take me some time to configure eclipse for some optimisation to help me working on this setup.
Even with that, operation on app.bdrun (saving, modification, run) is very slow. Each operation take around ~1mn on my setup. It will perhaps be a good thing if we extend the eclipse Ide setup documentation (https://next.openhab.org/docs/developer/ide/eclipse.html) with some recommandation about setting up core in Eclipse. There is already a recommandation about -Xmx parameter, but I think we can put more recommandation there. Laurent. |
@J-N-K , @pashalaev, Thanks for your hint / investiguation about ReadyMarker and ModelParser; Laurent. |
@lo92fr Some updates to the Eclipse developer documentations would certainly be helpful. The problem is that I don't feel that I've figured it out enough that I am in a situation to give anybody else advice at this point. Automatic build must be turned off. With it on, my computer gets stuck on the The validator you're referring to I'm not sure what is or where to disable, but if I could skip the "validation" when launching "demo.app" it would certainly save a lot of time - because that's what's causing the bulk of the delay during launch. As for your Eclipse options, I have no idea what is suitable, nor "safe", and all the memory configuration stuff depends on the hardware. Some hints in the documentation would probably be very helpful though. My laptop, which I'm using for this, also only has 16 GB RAM. I've got a very fast NVMe and the CPU is an i7-8550U. The motherboard doesn't seem to support any significantly faster CPUs, so not much to do there, but I am considering 32 GB RAM - which is supported. That said, when looking at the performance monitoring, it seems like the CPU is the main bottleneck for me. It works like crazy most of the time I do something in Eclipse. But, apart from running OH from Eclipse, this laptop is just fine for everything else I do - including my "regular" development in (a different installation of) Eclipse. I've never experienced Eclipse to be slow before, except when using the marketplace/updating software, but this "OH version" sure is extremely slow. I'm guessing it is because of the OSGi stuff. One thing to note is that we're talking about two different places where you can give JVM arguments: |
In regards of where time is spent. I'm align with you, we have not enough information to update the documentation. About validator, I'm not convinced that they are in cause in the launch time delay. I come to this old bdntool documentation about perf issue on windows later this morning. Laurent. |
@lo92fr There are some interesting things in your link - I just found 6.26 GB (over 58000 files and folders) of leftover OSGi "temp folders". I don't think that in itself causes a slowdown, but copying all these data for each launch probably does. As for antivirus exclusions, I have already excluded the Eclipse folder, the repo folder and the In my case, because I use TortoiseGit, I also has a background task that TortoiseGit use to update file icon overlays that goes quite crazy - so I frequently have to kill that (I don't think it's possible to disable without removing the overlays - and they are VERY useful IMO). edit: I added the I also see that some of the "optimizations" that you've put in |
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/millheat-local-api-development-questions/160139/25 |
Hi! I couldn't write earlier, but maybe my research will help in some way. On my system, during system startup, the order of calling functions is as follows: ItemRuntimeActivator.activate() As I believe, because of this sequence, the correct installation of ReadyMarker dsl:items does not occur and the creation of the openhab/conf/items folder is just a trick that allows the program to continue launching. From the logic of the program, it becomes clear that the first thing to do is launch the FolderObserver.activate() function, but I’m not such an expert in OSGi that I can say why on my system the sequence of calls is exactly this. Perhaps this depends on the performance of my system and then it is worth putting the Language Server bundle with ID 201 before the bundle with ID 198 Model Items to give OSGi more time to call FolderObserver.activate() My openhab/conf folder is empty before opening openhab for the first time. Then the ./ssh and /automation folders created by openhab appear in it and then I create the /items folder manually My system is esxi 6.5. Xeon E3-1260L 16Gb. For a virtual machine on debian12 with docker, 3 CPUs and 6GB RAM are allocated |
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/millheat-local-api-development-questions/160139/118 |
Hello all, Thanks for your very good analyze @pashalaev. @J-N-K : I'm not fully analyzed what happens so far, but what I can see:
I will tell you if I find more on this. Laurent. |
One more note, I don't see the marker at all for level 30 in the marker collections ! { |
Please have a look at https://github.com/openhab/openhab-distro/blob/main/distributions/openhab/src/main/resources/runtime/services.cfg There are several ready markers. It seems that you have an issue with your persistence and automation setup. |
Ok, I don't undestrand fully the reason for now, but it seems that something is not correctly registered somewhere. Laurent. |
I try to undestand why this level in not showing in StartLevelService. {osgi.ds.satisfying.condition.target=(osgi.condition.id=true), component.name=org.openhab.core.service.StartLevelService, 80=things:handler, 50=ruleengine:start, 20=dsl:items,managed:item,dsl:things,managed:thing,managed:itemchannellink,dsl:persist, service.pid=org.openhab.startlevel, component.id=37, 70=dsl:sitemap, 40=dsl:rules,managed:rule,rules:refresh,rules:dslprovider} |
I just see that in openhab-distro there is a comment on the line ! Start level definitionstartlevel:20=dsl:items,managed:item,dsl:things,managed:thing,managed:itemchannellink,dsl:persist org.jupnp:autoEnable=false |
So I can confirm now. https://github.com/openhab/openhab-distro/blob/main/launch/app/runtime/services.cfg is not in sync with So ready marker for level 30 are not there, and ThingManagerImpl is not initialized correctly in dev env. One more question : Do we really need this duplicates files in openhab-distro between the launch/app/runtime and openhab*/src folder.
Every time I ask myself which one is the good one to modify ! Laurent. |
Interesting at least for developers. I will test your change. |
I'm in process of updating bindings to OH 4 and spotted a bug, which I believe is related to new logic which improves reliability and predictability of thing startup process.
Bindings I have are rather basic in their form, one which I test with use no dynamic (generated) channels or thing types. Its entirely provided through XML descriptors. However, OH 4.0 makes it stuck in "NOT_YET_READY" state, despite of all descriptors being available and valid.
Expected Behavior
Valid thing types should cause handlers to be initialized.
Current Behavior
Despite of thing descriptors being properly parsed and available thing is marked as not ready, because its handler is refused.
I've traced it to a logic which populated "missing prerequisites". It turns that this collection is being feed in few places, but released only in one. This means that depending on startup order (and performance of machine), some handlers may never be used, because thing manager will miss opportunity to remove missing prerequisites, even if these conditions are met.
Please see below screenshot where missing prerequisites contains
co7io-amsads:network
, but thing thing type is already registered in appropriate registry:Steps to Reproduce (for Bugs)
So far I was not able to get a reproducer, as it is strictly speaking, dependent to startup order. If thing is added before thing descriptor is parsed - there is high probability that
ThingManager
will never update solved prerequisites.Your Environment
The text was updated successfully, but these errors were encountered: