Page 1 of 1
EventSystem: Warning!, lua script /home/pi/domoticz/dzVents/runtime/dzVents.lua has been running for more than 10 second
Posted: Thursday 04 April 2019 12:49
by heggink
I have a bunch of lua scripts none of which do extensive work or even wait for external systems (no http).
Still I regularly get this error. Better yet, turning on diagnostics (errors + minimal execution info), I get this message even though no script is running at the time. Anyone any thoughts?
I am on the latest beta with dxvents 2.4.16.
Thx
H
Re: EventSystem: Warning!, lua script /home/pi/domoticz/dzVents/runtime/dzVents.lua has been running for more than 10 se
Posted: Thursday 04 April 2019 17:35
by waaren
dzVents.lua is the dispatcher process for dzVents user scripts (which are effectively Lua functions) It is triggered by the domoticz event system for every event. Events can be time, device, group, scene, uservariable, HTTPResponse or security.
If dzVents.lua is activated it looks at all dzVents user scripts and execute them if any "on = section" condition is met. dzVents.lua ends not earlier than all these user scripts have finished processing.
So for example if you have 5 user-scripts executing every 1,2,3,5 and 30 minutes then dzVents.lua waits for 1 script after minute 1, for 2 scripts after minute 2, -3 and -5, but for 5 scripts after minute 30.
Something similar can happen with devices.
Another reason why this message can come up is when the database is locked by another process. I see this sometimes when my automatic database backup kicks in but also at other times of which I have not found yet what process is responsible for the lock. Could also be something on the OS level requiring exclusive disk IO.
Re: EventSystem: Warning!, lua script /home/pi/domoticz/dzVents/runtime/dzVents.lua has been running for more than 10 se
Posted: Friday 05 April 2019 15:05
by pvm
Is Domoticz blocked for other tasks during the complete execution of dzVents.lua?
Re: EventSystem: Warning!, lua script /home/pi/domoticz/dzVents/runtime/dzVents.lua has been running for more than 10 se
Posted: Friday 05 April 2019 17:10
by waaren
pvm wrote: Friday 05 April 2019 15:05
Is Domoticz blocked for other tasks during the complete execution of dzVents.lua?
No only the event thread. That is also true for Blockly and Lua scripts. The other threads (see below for an example how it looks on my system are not blocked)
Code: Select all
$pstree 16295
domoticz-+-sh
|-{Darksky}
|-{Domoticz_HBWork}
|-{EventSystemQueu}
|-{EventSystem} -- event thread
|-{EvoHome}
|-{HardwareMonitor}
|-{Harmony}
|-{InfluxPush}
|-{MQTT}
|-{MainWorkerRxMsg}
|-2*[{MainWorker}]
|-{P1 Meter}
|-{Philips Hue}
|-{PluginMgr_IO}
|-{PluginMgr}
|-{Plugin_BatteryL}
|-{Plugin_Homewiza}
|-{Plugin_NUT_UPS}
|-{Plugin_Sonos}
|-{Plugin_xfr-pimo}
|-2*[{RFLink}]
|-2*[{RFXCOM}]
|-{SQLHelper}
|-{Scheduler}
|-{TCPServer}
|-{Watchdog}
|-{WebServer_8084}
|-{Webem_ssncleane}
|-{XiaomiGatewayIO}
|-{Xiaomi}
|-{YeeLight}
|-{YouLess}
`-4*[{ZWaveBase}]
Re: EventSystem: Warning!, lua script /home/pi/domoticz/dzVents/runtime/dzVents.lua has been running for more than 10 se
Posted: Sunday 07 April 2019 10:58
by heggink
Figured it out: I also have SBFspot running on the same pi to upload solar panel data. After 7 years, the database has grown such that the SBFspot task, that runs every 5 minutes, grabs 100% of the CPU. Apparently that messed up domoticz to the degree that it caused both this message as well as regular errors around threads that seemed to have ended unexpectedly.
Moved the DB to MySQL on my freenas and now everything is OK again. The tricky part was to see the SBFspot CPU power as it only ran every 5 minutes and there were no errors in any logs. As a result, I was looking in the wrong place for answers...
Thanks all!