openhab-core: Group is sometimes missing state updates from members

Expected Behavior

If a member of a group changes or updates it’s state, the group’s StateChangeListener should get informed.

Current Behavior

Most times when a group member updates or changed its state, the group’s listeners are not informed. The weird behaviour is, that this is not always the case.

https://github.com/openhab/openhab-core/blob/ac0f512178e5a5949032f16aaec7fd3896678574/bundles/org.openhab.core/src/main/java/org/openhab/core/items/GenericItem.java#L258-L279

I found out that:

  1. notifyListeners is called and clonedListeners contains the listeners as expected.
  2. for each of clonedListeners pool.execute is called.
  3. Without any exception being thrown and logged, listener.stateUpdate and listener.stateChanged if stateChanged are never called.

Possible Solution

Steps to Reproduce (for Bugs)

  1. Create a Group:Switch:OR(ON,OFF)
  2. Put in at least one Switch Item
  3. Switch that group member from the UI and have a look at the logs. Sometimes, the group Item won’t update it’s state.

Context

Your Environment

  • Version used: 4.0.0.M2
  • Environment name and version (e.g. Chrome 111, Java 17, Node.js 18.15, …):
  • Operating System and version (desktop or mobile, Windows 11, Raspbian Bullseye, …): Debian 11 64-bit

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 26 (26 by maintainers)

Most upvoted comments

Since it has been confirmed that this is an issue in adding, I’ll close it here.

Thanks. I added additional logging around the scheduling. Can you update (and restart) again? The additional logging is only for Balkon_Steckdose, otherwise your log would be totally unreadable.