openhab / openhab-webui

Web UIs of openHAB
Eclipse Public License 2.0
214 stars 235 forks source link

Openhab Rules settings mains pages freeze in last 4.2.0 M3 when having a lot of rules. #2621

Closed lo92fr closed 2 weeks ago

lo92fr commented 3 weeks ago

Openhab Rules settings mains pages freeze in last 4.2.0 when having a lot of rules.

I notice that the rule settings main page (the one where you have all your rule listed), is freezing when you have a lot of rules defined. This happens in Chrome as well has in Firefox. The CPU seems to go up, and after a few seconds, the page display, but you can no more interact with it. My number of rules is about 62, and the problems seems to begin if you have about more than 40 rules.

image

I'm not able to said if it a new bug, or if it was occuring before as I add several rules in my setup last week, so possibly was already there in previous version.

This issue seems difficult to trace has the tab just freeze, as well has the developper tools, and the only action possible is to close the tab.

Expected behavior

Rule page loading and being able to interact with the page to see details of the rules.

Steps to reproduce

  1. Create many rules > 50.
  2. Navigate to the settings > rules pages.
  3. Navigator freeze after loading and displaying the page

Your environment

runtimeInfo:
  version: 4.2.0
  buildString: "Build #4070"
locale: fr-FR
systemInfo:
  configFolder: /opt/openhab4/conf
  userdataFolder: /opt/openhab4/userdata
  logFolder: /opt/openhab4/userdata/logs
  javaVersion: 17.0.9
  javaVendor: Red Hat, Inc.
  javaVendorVersion: (Red_Hat-17.0.9.0.9-4)
  osName: Linux
  osVersion: 6.8.4-200.fc39.x86_64
  osArchitecture: amd64
  availableProcessors: 12
  freeMemory: 178418456
  totalMemory: 1073741824
  uptime: 186358
  startLevel: 70
addons:
  - automation-groovyscripting
  - automation-jrubyscripting
  - automation-jsscripting
  - automation-pwm
  - binding-airq
  - binding-airquality
  - binding-androiddebugbridge
  - binding-androidtv
  - binding-astro
  - binding-bluetooth
  - binding-chromecast
  - binding-denonmarantz
  - binding-enigma2
  - binding-exec
  - binding-freeboxos
  - binding-harmonyhub
  - binding-heos
  - binding-homeconnect
  - binding-hue
  - binding-icalendar
  - binding-icloud
  - binding-ipp
  - binding-knx
  - binding-lgwebos
  - binding-lifx
  - binding-linuxinput
  - binding-lirc
  - binding-mail
  - binding-miele
  - binding-mielecloud
  - binding-mqtt
  - binding-network
  - binding-networkupstools
  - binding-ntp
  - binding-openweathermap
  - binding-pioneeravr
  - binding-rfxcom
  - binding-samsungtv
  - binding-smartthings
  - binding-sonyprojector
  - binding-spotify
  - binding-squeezebox
  - binding-upnpcontrol
  - binding-zigbee
  - binding-zoneminder
  - misc-homekit
  - misc-openhabcloud
  - persistence-influxdb
  - transformation-bin2json
  - transformation-exec
  - transformation-jinja
  - transformation-jsonpath
  - transformation-map
  - transformation-regex
  - transformation-rollershutterposition
  - transformation-scale
  - transformation-vat
  - transformation-xpath
  - transformation-xslt
  - ui-basic
  - ui-cometvisu
  - ui-habot
  - ui-habpanel
  - voice-googlestt
  - voice-googletts
  - voice-mactts
  - voice-marytts
  - voice-mimictts
  - voice-picotts
  - voice-rustpotterks
  - voice-voicerss
  - voice-voskstt
  - voice-watsonstt
clientInfo:
  device:
    ios: false
    android: false
    androidChrome: false
    desktop: true
    iphone: false
    ipod: false
    ipad: false
    edge: false
    ie: false
    firefox: false
    macos: false
    windows: true
    cordova: false
    phonegap: false
    electron: false
    nwjs: false
    webView: false
    webview: false
    standalone: false
    os: windows
    pixelRatio: 1
    prefersColorScheme: light
  isSecureContext: true
  locationbarVisible: true
  menubarVisible: true
  navigator:
    cookieEnabled: true
    deviceMemory: 8
    hardwareConcurrency: 16
    language: fr-FR
    languages:
      - fr-FR
      - fr
      - en-US
      - en
    onLine: true
    platform: Win32
  screen:
    width: 1920
    height: 1080
    colorDepth: 24
  support:
    touch: false
    pointerEvents: true
    observer: true
    passiveListener: true
    gestures: false
    intersectionObserver: true
  themeOptions:
    dark: light
    filled: true
    pageTransitionAnimation: default
    bars: light
    homeNavbar: default
    homeBackground: default
    expandableCardAnimation: default
    blocklyRenderer: null
  userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,
    like Gecko) Chrome/126.0.0.0 Safari/537.36
timestamp: 2024-06-23T14:18:24.594Z

Browser console

Nothing displayed, no error

Browser network traffic

image

Additional information

florian-h05 commented 2 weeks ago

Can you please follow the steps in https://github.com/openhab/openhab-webui/pull/2623#issuecomment-2186656874 and report back if this fixes your issue?

lo92fr commented 2 weeks ago

Hello Florian,

Thanks for your help. I've justed test it, and it's ok, this fix the issue.

Laurent.

florian-h05 commented 2 weeks ago

Great, thanks for the fast answer!

florian-h05 commented 2 weeks ago

I'm not able to said if it a new bug, or if it was occuring before as I add several rules in my setup last week, so possibly was already there in previous version.

BTW it is not a new "bug", there was no change in the related code parts. The "bug" ever existed since openHAB 3.0, but it only occurs when there are many rule status changes. The UI gets the rule status in real-time from the server through a SSE event stream and processes the received data, and this processing was too slow.