You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 7, 2020. It is now read-only.
User ptweety made the following observation in when testing OH 2.4.0 M6:
there seems to be some kind of issue (just a warning though) with my item definition. I have 2 or 3 channels linked to a single item. Is this use case deprecated?
2018-11-22 19:51:01.838 [WARN ] [ore.common.registry.AbstractRegistry] - Cannot add "Metadata" with key "channel:aLivingCeilingBulb". It exists already from provider "GenericMetadataProvider"! Failed to add a second with the same UID from provider "GenericMetadataProvider"!
2018-11-22 19:51:01.839 [WARN ] [ore.common.registry.AbstractRegistry] - Cannot add "Metadata" with key "channel:aLivingCeilingBulb". It exists already from provider "GenericMetadataProvider"! Failed to add a second with the same UID from provider "GenericMetadataProvider"!
2018-11-22 19:51:01.844 [WARN ] [ore.common.registry.AbstractRegistry] - Cannot add "Metadata" with key "channel:aLivingFloorRightBulbs". It exists already from provider "GenericMetadataProvider"! Failed to add a second with the same UID from provider "GenericMetadataProvider"!
2018-11-22 19:51:01.845 [WARN ] [ore.common.registry.AbstractRegistry] - Cannot add "Metadata" with key "channel:aLivingFloorRightBulbs_switch". It exists already from provider "GenericMetadataProvider"! Failed to add a second with the same UID from provider "GenericMetadataProvider"!
2018-11-22 19:51:01.846 [WARN ] [ore.common.registry.AbstractRegistry] - Cannot add "Metadata" with key "channel:aLivingFloorLeftBulbs". It exists already from provider "GenericMetadataProvider"! Failed to add a second with the same UID from provider "GenericMetadataProvider"!
2018-11-22 19:51:01.847 [WARN ] [ore.common.registry.AbstractRegistry] - Cannot add "Metadata" with key "channel:aLivingFloorLeftBulbs_switch". It exists already from provider "GenericMetadataProvider"! Failed to add a second with the same UID from provider "GenericMetadataProvider"!
Analysis:
At first it was thought this was related to pr performance improvements for registries #6438. Because that change modified the lines that were changed. However up on better looking at it the warning was already present and should have been given without the change.
The provider mentioned in the warning GenericMetadataProvider triggers this warning from the method addMetadata and that method is only called from GenericItemProvider.
bindingConfigReaders.get(bindingType) is null if bindingType isn't in bindingConfigReaders. And that only seems to be possible if addBindingConfigReader is not called before a call to internalDispatchBindings with a null reader is done.
Questions
Because these 2 calls seem to be triggered by service availability this looks like a timing issue. Where one call becomes before the other. It could even be due to the initial mentioned pr because that improved performance and it can be this changes the order because some services are now faster. Or was it intended design that it always was called in that order?
Looking at the warning message it tries to add channel:aLivingFloorLeftBulbs_switch as a meta data tag. That seems strange because channel should not be added as a meta tag. So why is is added as a meta tag?
The use of method internalDispatchBindings looks somewhat complex. There are several methods calling this method from different starting points. Maybe it needs some improvement here, like calling with a null reader to trigger a specific path seems somewhat hacky.
The question is if this is a problem. At first sight it looks like it might not be a problem it just tries to add a channel as a second meta tag. tags in an item must be unique, but channels are an exception. So it's ok to add multiple channels to an item and when added all these as meta tags the warning is logical because then. So the questions remain why is it adding channel as a tag? and what (change) could trigger this?
The text was updated successfully, but these errors were encountered:
That seems strange because channel should not be added as a meta tag. So why is is added as a meta tag?
My assumption is that the GenericItemChannelLinkProvider (which implements BindingConfigReader) is not started at that moment and hence "channel" is considered to be some "random" meta-data.
At first sight it looks like it might not be a problem it
If the expected meta-data is available, it probably is not a problem that will break anything. Having "channel" metadata added is a bit ugly, but it shouldn't harm. Doing changes to internalDispatchBindings sounds pretty risky to me, so I'd rather go with reducing the log level for now.
Problem description:
User ptweety made the following observation in when testing OH 2.4.0 M6:
Analysis:
GenericMetadataProvider
triggers this warning from the methodaddMetadata
and that method is only called fromGenericItemProvider
.addMetaData
was added in pr [Core] Added item metadata infrastructure #4390 related to adding meta data.BindingConfigReader
must benull
in methodinternalDispatchBindings
reader
is null andbindingConfigReaders.get(bindingType)
also returns null.bindingConfigReaders.get(bindingType)
is null ifbindingType
isn't inbindingConfigReaders
. And that only seems to be possible ifaddBindingConfigReader
is not called before a call tointernalDispatchBindings
with a nullreader
is done.Questions
channel:aLivingFloorLeftBulbs_switch
as a meta data tag. That seems strange becausechannel
should not be added as a meta tag. So why is is added as a meta tag?internalDispatchBindings
looks somewhat complex. There are several methods calling this method from different starting points. Maybe it needs some improvement here, like calling with a null reader to trigger a specific path seems somewhat hacky.channel
as a tag? and what (change) could trigger this?The text was updated successfully, but these errors were encountered: