-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
Fix ThingManager is missing config description during normalization #3191
Conversation
Reported on the forum. In some cases the `ThingManageImpl` tried to initialize the thing before all config descriptions are loaded. This can happen because the `OH-INF/config` directory is processed in parallel to the thing descriptions. In case the handler factory is added and the thing description parser sets the corresponding `ReadyMarker` before the config descriptions are completly parsed this results in a warning because the config description cannot be found during normalization of the thing or channel configuration. Signed-off-by: Jan N. Klug <github@klug.nrw>
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/126 |
I am not sure approach in this PR is valid because relying on registering config descriptors in thing manager builds functionality which should be provided by config layer itself. Maybe a new Just an idea: With this approach each step has its own responsibility and ThingManager can be free of internals of config descriptor discovery. |
The problem with that approach is that the All config descriptions are available, when the bundle has been processed, so this is a sort of short-cut. The same approach is used for the thing descriptions themself, so I merely extended what is already there. |
Thanks for explaining detail of issue. Still I don't think that tracking directly appearing of config descriptors within thing manager itself is fully justified. A basic fact that thing manager tracks thing types which might be provided by |
While it is incomplete it is at least better than what we have now. I did check if an alternative approach is possible and that requires a BIG refactoring. It is quite easy to check if all dependencies are met (we can just check for the thing and all of it's channels if the type is present in the respective registry and if a config description uri is present and the config description itself is present in the registry). What makes it difficult is that we need a trigger to check if a thing can be initialized. We currently use two of these: a ready marker when a bundle has finished loading thing types and the addition of a thing handler factory. This PR adds a third one - a ready marker when a bundle has finished loading config descriptions. If we don't use the ready markers anymore, we would need to be notified of a change in |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/openhab-3-4-release-discussion/142257/131 |
Closing, will be superseded by another solution that also tries to solve #1924. |
Reported on the forum. In some cases the
ThingManageImpl
tried to initialize the thing before all config descriptions are loaded.This can happen because the
OH-INF/config
directory is processed in parallel to the thing descriptions. In case the handler factory is added and the thing description parser sets the correspondingReadyMarker
before the config descriptions are completly parsed this results in a warning because the config description cannot be found during normalization of the thing or channel configuration.Signed-off-by: Jan N. Klug github@klug.nrw